Does local win7 TP5 use Redis to implement concurrent processing?
葫芦娃平衡盘
葫芦娃平衡盘 2018-03-14 18:34:12
0
4
1536

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

葫芦娃平衡盘
葫芦娃平衡盘

reply all(3)
寻觅 beyond

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

  • reply Well, indeed, I searched and found the message queue.
    葫芦娃平衡盘 author 2018-03-19 10:02:48
sky

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 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?
    葫芦娃平衡盘 author 2018-03-16 17:28:20
猪哥

Set up a REDIS server and change the cache to redis

  • reply 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.
    葫芦娃平衡盘 author 2018-03-15 17:33:57
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!