3 ms·
>Currently all redis-based background job implementations does not support scheduled jobs. That has been false for 4 years. https://github.com/resque/resque-s
by aaronblohowiak 13y ago
>Currently all redis-based background job implementations does not support scheduled jobs.
That has been false for 4 years.
https://github.com/resque/resque-scheduler https://github.com/resque/resque-scheduler
- est 13y agoIt's polling based approach. https://github.com/resque/resque-scheduler/blob/master/lib/resque/scheduler.rb#L36 https://github.com/resque/resque-scheduler/blob/master/lib/r... https://github.com/resque/resque-scheduler/blob/master/lib/resque_scheduler.rb#L225 https://github.com/resque/resque-scheduler/blob/master/lib/r... Resque will scan for set value with key prefix like "timestamps:" or "delayed:", for every five seconds, if there's any task queued it will be fired. There's many pros/cons with this approach, e.g. in Redis SADD, SMEMBERS are O(N) operations while in theory dedicated cron algorithm could make O(log(n)). https://en.wikipedia.org/wiki/Cron#Multi-user_capability https://en.wikipedia.org/wiki/Cron#Multi-user_capability This is is important if you have many short lived, timestamp based events need to handle. My use case is design item cool down for a mobile/web game using server side push, with millions of users. While resque could in theory solve this problem, but it's no different from a per 5 minute crontab command. So anyway, what I hope is a native clock in Redis handling all this.