class Rufus::Job

def trigger


Triggers the job (in a dedicated thread).
def trigger
  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 trigger_thread_alive? and (to = @params[:timeout])
    @scheduler.in(to, :tags => 'timeout') do
      @trigger_thread.raise(Rufus::TimeOutError) if trigger_thread_alive?
    end
  end
end