Monday, January 11, 2010

Added Resque.enqueue_in for delayed resque jobs

Moved here

Last week I added support for delayed jobs in resque to the resque-scheduler gem. You can now do stuff like this:
  Resque.enqueue_in(5.days, SendEmailFollowup, :user_id => current_user.id)
And in 5 days, the job will be queued for work as if you called Resque.enqueue directly. Alternatively, you can call enqueue_at and pass it a Time instance (or unix timestamp as an int) instead of a number of seconds. There's also an additional tab in resque-web for viewing delayed jobs. For screen shots and more details, check it out on github. If you're interested in calling jobs on a recurring basis, checkout my previous post on using resque-scheduler to replace cron jobs that just call ruby scripts.

1 comment:

Brian P O'Rourke said...

This is great - it's exactly the feature I've been looking for. Thanks for the great work!