10 ms·
Redis has blocking list primitives which you can use to build an efficient queue (push and pop in O(1)), if you look at the code you'll see he's using brpop
by wcummings 12y ago
Redis has blocking list primitives which you can use to build an efficient queue (push and pop in O(1)), if you look at the code you'll see he's using brpop
- ankurpatel 12y agoI agree but there is no need to poll. Polling is a poor mans solution in a world where you can have persistent connection and get push notification of when a new item is added to the queue and there is no need to throttle for 10 seconds before polling again.
- danneu 12y agoA listening pattern still has to poll on boot for unprocessed jobs.