News for hackers. Stuff that matters.
Re:Resque Bus by est on Sunday September 29, 2013 @12:04AM (#6464085)
One thing I really hope with Redis's PUB/SUB is that it could support a time parameter, so we could develop a cronjob replacement, could be add/delete dynamically, and broadcast, and managable with API or Web UI.

Currently all redis-based background job implementations does not support scheduled jobs.

Redis is not only a memcache replacement, but also a good data structure server, as central hub I hope it add more time-sturcture functions.

Re:Resque Bus by aaronblohowiak on Sunday September 29, 2013 @01:10AM (#6464197)
>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

Re:Resque Bus by est on Sunday September 29, 2013 @03:17AM (#6464408)
It's polling based approach.

https://github.com/resque/resque-scheduler/blob/master/lib/r...

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

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.

Re:Resque Bus by 616c on Sunday September 29, 2013 @02:09AM (#6464296)
I know it is not quite what you are looking for, but if you looking at that type of cronjob replacement, did you not see a HN link to AirBNB guys talking about their tool Chronos? You might like that.

http://nerds.airbnb.com/introducing-chronos/

Re:Resque Bus by jordanthoms on Sunday September 29, 2013 @12:36AM (#6464146)
Re:Resque Bus by bleonard on Sunday September 29, 2013 @12:19AM (#6464112)
I preferred the approach described here over pure Redis pub/sub because of the ability to disconnect or lose connections and still end up with the data eventually.

Specifically about "cron" capability, resque-scheduler does a pretty good job for Resque in general. Resque Bus uses it for exponential-backoff retry.

It uses the scheduling capability for the "Heartbeat" described in the README. I'll write more about that later if people are interested. Quickly, it's an automated way to add events every minute. We use this like a global (shared across applications and servers) cron clock.

Re:Resque Bus by Argorak on Sunday September 29, 2013 @02:41PM (#6466077)
If you don't mind running development versions: Notifications can be a part of building that. Problem: you (currently) have to be connected when it happens.

http://redis.io/topics/notifications