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
寻觅 beyond2018-03-17 23:48:43
The focus of your question should be shifted to --->Message queue, redis is just one of the methods
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