Thin wrapper around rufus-scheduler gem, specifically designed to ease configuration of a scheduler and provide some added simplicity.
For more information on rufus-scheduler, please visit the RDoc's at rufus.rubyforge.org/rufus-scheduler/
To use the evented scheduler, call #DaemonKit::EM.run prior to setting up your first schedule.
Access to the scheduler instance
# File lib/daemon_kit/cron.rb, line 20 def instance @instance ||= new end
# File lib/daemon_kit/cron.rb, line 44 def initialize @scheduler = Rufus::Scheduler.start_new end
Once the scheduler has been configured, call run to block the current thread and keep the process alive for the scheduled tasks to run
# File lib/daemon_kit/cron.rb, line 33 def run DaemonKit.logger.info "Starting rufus-scheduler" if instance.is_a?( Rufus::Scheduler::PlainScheduler ) instance.scheduler.join else Thread.stop end end
Generated with the Darkfish Rdoc Generator 2.