search

Home  >  Q&A  >  body text

Does local win7 TP5 use Redis to implement concurrent processing?

I am a newbie. I am making a purchase function. When there is only one item left but two people purchase it at the same time, how should I handle this situation? I only learned about Redis a few hours ago using the TP5 framework. I really don’t know how to use TP5. Is there any way to deal with this situation? I hope there are detailed examples and ideas. My own idea is similar to a queue. Two people click at the same time, one by one. deal with

葫芦娃平衡盘葫芦娃平衡盘2479 days ago1565

reply all(4)I'll reply

  • 寻觅 beyond

    寻觅 beyond2018-03-17 23:48:43

    The focus of your question should be shifted to --->Message queue, redis is just one of the methods

    reply
    0
  • 葫芦娃平衡盘

    Well, indeed, I searched and found the message queue.

    葫芦娃平衡盘 · 2018-03-19 10:02:48
  • sky

    sky2018-03-16 17:20:32

    When there is one item left, they can all join the shopping. When the actual purchase is made, check the database and give a prompt if the goods are insufficient

    reply
    0
  • 葫芦娃平衡盘

    In the end, I solved it like this, but I still don’t understand Redis very well. I want to learn this idea. How did I solve this situation when I encountered this situation during real project development? Is it Redis? Do you understand?

    葫芦娃平衡盘 · 2018-03-16 17:28:20
  • PHP中文网

    PHP中文网2018-03-15 15:14:48

    Set up a REDIS server and change the cache to redis

    reply
    0
  • 葫芦娃平衡盘

    I want to run it locally first and see. I have installed Redis and added RedisTool to TP. The configuration is also done, but the specific ideas and methods are not available. I am still very unfamiliar with it.

    葫芦娃平衡盘 · 2018-03-15 17:33:57
  • Cancelreply