class Rufus::Job
def trigger
Triggers the job (in a dedicated thread).
def trigger t = Thread.new do @trigger_thread = Thread.current # keeping track of the thread begin do_trigger rescue Exception => e @scheduler.send(:log_exception, e) end #@trigger_thread = nil if @trigger_thread == Thread.current @trigger_thread = nil # overlapping executions, what to do ? end if t.alive? and (to = @params[:timeout]) @scheduler.in(to, :tags => 'timeout') do @trigger_thread.raise(Rufus::TimeOutError) if t.alive? end end end