Application background
If the order is not paid within 30 minutes after the order is placed, the order will be canceled
No one responds to the timeout request for rent and purchase, the deposit will be returned
Various businesses that can be implemented using timeout
Application principle
Redis setex sets a key for a specified time, setex order_no 1800 1
Open psubscribe Listen for key expiration events. Note that setex psubscribe needs to be in the same Redis db
Business implementation
Processed according to the key in the callback Business ~ Feel free here
Linux configuration
redis introductory tutorial column.
The above is the detailed content of Redis implements order cancellation if not paid within 30 minutes. For more information, please follow other related articles on the PHP Chinese website!