Delayed execution / scheduling with Redis?
问题 Any tricks to do delayed task execution (i.e. scheduling) based on Redis? Perhaps some clever way to delay BLPOP for a given number of seconds?.. 回答1: You can work with a ring of multiple LISTs that have a time component in their name. As time component you can take the current second (0-59). You always add tasks to the list for the current second. To get the jobs you do a BLPOP (with low timeout) only on those lists where it is guaranteed, that the content is older than the given number of