Created
January 22, 2010 01:30
-
-
Save soulware/283421 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rufus-scheduler' | |
# the following example should poll every 5s | |
# and trigger a job at seconds 0,10,20,30,40,50 | |
# but no jobs ever fire unless we are very lucky with our timing | |
scheduler = Rufus::Scheduler::PlainScheduler.start_new(:frequency => 5.0) | |
scheduler.cron "0,10,20,30,40,50 * 0-59 * * *" do | |
puts "doing something #{Time.now}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment