class Rufus::Scheduler::PlainScheduler
original rufus-scheduler).
A classical implementation, uses a sleep/step loop in a thread (like the
def join
def join @thread.join end
def start
def start @thread = Thread.new do loop do sleep(@frequency) step end end @thread[:name] = @options[:thread_name] || "#{self.class} - #{Rufus::Scheduler::VERSION}" end
def stop(opts={})
will not interrupt the job run).
currently running, this method will wait for it to terminate, it
(note that if a job is
are done with their current run if any.
the method will return once all the jobs have been unscheduled and
If the option :terminate is set to true,
== :terminate => true
Stops this scheduler.
def stop(opts={}) @thread.exit terminate_all_jobs if opts[:terminate] end