I need a scheduler for large dynamic collections of tasks. At the moment I'm looking at resque-scheduler, rufus-scheduler, and clockwork. I'll be grateful for advice on choosing which one (or what alternative) to use.
Some details:
Summarizing, I need something like cron for Ruby project that can handle a large, dynamically changing collection of tasks.
Update: I've spent a day experimenting with scheduling libraries, and now I'd like to briefly summarize newly obtained experience.
I've stopped my attention at Clockwork and resque-scheduler libraries, due these are more mature projects with more detailed documentation. Resque-scheduler is based on rufus-scheduler while Clockwork is inspired by it, both can be used for the solution I'm looking for.
Both are standalone services supposed to be running in separate process, that can handle virtually unlimited amount of tasks scheduled for single or recurrent execution. Tasks are executed within threads.
Clockwork pros:
Clockwork cons:
I've implemented an alternative Manager class for Clockwork (this is a core part of the gem that controls scheduling) to allow scheduling control through ZeroMQ messages. So the main service in my project can send commands to the scheduler, like "run this each day", or "unschedule task #10", and the scheduler executes each request immediately.
I have less experience with resque-scheduler, but at this point it looks like a better solution.
resque-scheduler pros:
Resque.remove_schedule(name)
to drop a specific task.resque-scheduler:
May be something else will appear, after closer look, but there is nothing else at the moment.
That is what I have now. BTW, I've published a number of links to the scheduling-related Ruby gems on GitHub.
are somehow pure schedulers. Whenever is backed by Crond, so it's solid (but jobs will get executed in distinct processes). Rufus-scheduler and Clockwork are similar, in Ruby process, schedulers (Clockwork was inspired by rufus-scheduler).
Resque-scheduler (https://github.com/resque/resque-scheduler) builds on top of Resque (task management) and rufus-scheduler (schedule management).
You should have a look at Sidekiq (http://sidekiq.org/) too. Look at https://www.google.com/?q=sidekiq%20scheduler#q=sidekiq+scheduler
So learn about Resque and Sidekiq, then look at the schedulers available for them. If there is nothing that suits you, look at the schedulers (Whenever, rufus-scheduler, Clockwork, ...) themselves, maybe you can build on top of them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With