A classical implementation, uses a sleep/step loop in a thread (like the original rufus-scheduler).
# File lib/rufus/sc/scheduler.rb, line 450 def join @thread.join end
# File lib/rufus/sc/scheduler.rb, line 431 def start @thread = Thread.new do loop do sleep(@frequency) step end end @thread[:name] = @options[:thread_name] || "#{self.class} - #{Rufus::Scheduler::VERSION}" end
# File lib/rufus/sc/scheduler.rb, line 445 def stop(opts={}) @thread.exit end