I've had a look at a number of scheduling libraries for Rails and I'd like some help choosing one, given that none quite seem to meet my requirements. It's a fairly common use case:
We have a number of reports and we'd like to let users set up when they would want to schedule when and how often a particular report is sent to them by mail. Users need to be able to see a list of the reports they have scheduled and they should be able to cancel or change existing scheduled reports. Scheduled jobs should survive restarts of the server. At the moment I'm not worried about only running jobs on a single node in a cluster of rails servers.
I would recommend using Delayed::Job for the actual jobs, as it automatically handles persistence for your users, and you can use the delayed_jobs
table for the management (allowing users to modify/delete jobs that they've started).
When it comes to automatically scheduling jobs, you can use the Clockwork gem. It was built by Heroku (If I'm not mistaken), and essentially allows you to emulate/replace cron
within your ruby/rails app.
With the two libraries above, you've got all your bases covered.
I would decide against resque for exactly the same reasons. Instead we went for delayed-job as well, and indeed, the last thing a job does, is reschedule the job to run again next time.
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