Because you want to monitor the queue, there must be a program running in the background to consume the queue. If you want to grab the red envelope, you can use the blocked version of BPOP, which requires real-time, so you will wait until there are elements before continuing execution.
Uh-huh, is it really good to open a thread to read the redis queue, so that the program of the thread pool will keep going? Is there a better way? (1 year ago) reply
No problem, get the data in the list through push and pop, usually LPUSH RPOP, and reply in first-in first-out order (1 year ago).
Thank you for your answers. I am new to it, too. I wrote a pub/sub demonstration yesterday.