Rufus Scheduler: Simple Task Scheduling from Rails Apps

Brent Collier of Intridea has written Dead simple task scheduling in Rails that highlights the use of Rufus-Scheduler, by John Mettraux, to perform, well.. dead simple tasks scheduling from a Rails app!

Rufus-Scheduler is the latest version of a scheduler previously known as openwferu-scheduler (try saying that quickly three times). It's not a Rails-only deal but Brent shows how to install it for use from within a Rails app. It parses time strings, so you can tell it to schedule something to occur "every 10m10s" (10 minutes 10 seconds) or to occur at "Sun Oct 07 14:24:01 +0900 2009" or you can supply it with a cron-style string.

The scheduler doesn't do any server-side voodoo to get jobs to run, but relies on its scheduler being run up and maintained persistently (or semi-persistently, as with Rails app processes that will tip the scheduler into action).

As an aside, Intridea are running an Introduction to Ruby on Rails course between February 27 and March 1, 2009 (yes, in 11 days!) in Washington DC. So if you want to go and learn Rails from two ultra qualified Rails guys (Adam Bair and Joe Grossberg) go check it out.

Tweet This Post