about processes and engines

rufus-scheduler 1.0.9 released

just released the “rufus-scheduler” 1.0.9 [gem].

It fixes a few bugs, mainly making jobs visible via get_job(job_id) even when they are right in the middle of execution.

It also introduces 4 new shorter aliases : “at”, “in”, “every” and “cron” (to “schedule_at”, “schedule_in”, “schedule_every” and “schedule” respectively) :

require 'rubygems'
require 'rufus/scheduler' # gem 'rufus-scheduler'

scheduler = Rufus::Scheduler.start_new"3d") do
  # will call the regenerate_monthly_report method
  # in 3 days from now

scheduler.every "10m10s" do
  # every 10 minutes and 10 seconds

scheduler.cron "0 22 * * 1-5" do "activating security system..."
end "Sun Oct 07 14:24:01 +0900 2009" do

Changelog :

– bug #21262 : brought back (proxy) duration_to_f to Rufus::Scheduler
– todo #21251 : added ‘at’, ‘cron’, ‘in’ and ‘every’ shortcut methods
– todo #21203 : keeping track of At and EveryJob until last trigger is over
– todo #20823 : now raising exception in case of bad ‘at’ parameter
– todo #21194 : added trigger_thread to Job class
– todo #21193 : spinned CronLine out to rufus/cronline.rb
– bug #20893 : sometimes unschedule(every_job) not working when job was active (performing). Fixed.

Links :

Thanks to Sean Liu, Adam and Rael for their help.

Written by John Mettraux

July 18, 2008 at 4:52 am

8 Responses

Subscribe to comments with RSS.

  1. thank you for the duration_to_f fix ;) I know that was a private method and taskr sort of hacked it to be public, but thanks for the quick turnaround!

    Adam Greene

    July 20, 2008 at 5:49 am

  2. Hi Adam, thanks a lot. I wish you all the best for your endeavour.


    John Mettraux

    July 20, 2008 at 6:03 am

  3. I’m trying to integrate rufus-scheduler into Rails and I’m running into an annoyance that you have to keep track of the scheduler object across different Rails calls. Is there a correct way to do this?

    I would really like something like Rufus::Scheduler.all_schedulers which will return all the schedulers in the system so I don’t have to worry about persistence from within Rails itself.

    Xianhang Zhang

    October 19, 2008 at 2:55 pm

  4. Hello Xianhang,

    you’ll find my answer at


    John Mettraux

    October 19, 2008 at 11:30 pm

  5. Hi John. I’ve been meaning to have a look at scheduler for a little while now and have finally been given a job which suits scheduler down to the ground. However i installed the gem, copied/pasted the example code and found that the examples didn’t work. I’m developing on WinXP and wonder whether there are any known issues with the gem Windows systems?

    The code is:
    require ‘rubygems’
    require ‘rufus/scheduler’

    scheduler = Rufus::Scheduler.start_new

    scheduler.every “10s” do
    print( “This should be output every ten seconds” )

    It sits for 10 seconds and the terminates. Any ideas


    November 10, 2008 at 1:56 pm

  6. Hi Jim,

    my answer is at :

    (It’s easier to have a conversation on the mailing list)

    Best regards,


    John Mettraux

    November 10, 2008 at 2:13 pm

  7. I have a web application in rails for online appointment scheduling.I need to send notification for every appointment before some predefined time interval. Please suggest how to implement this logic using scheduling.


    May 8, 2009 at 11:42 am

  8. Hi Smita, you’ll find the mailing list for rufus-scheduler at

    You can submit your question there.

    Best regards,

    John Mettraux

    May 8, 2009 at 11:57 am

Comments are closed.

%d bloggers like this: