lib/queue_classic/worker.rb
def process(queue, job)
      start = Time.now
      finished = false
      begin
        call(job).tap do
          queue.delete(job[:id])
          finished = true
        end
      rescue => e
        handle_failure(job, e)
        finished = true
      ensure
        if !finished
          queue.unlock(job[:id])
        end
        ttp = Integer((Time.now - start) * 1000)
        QC.measure("time-to-process=#{ttp} source=#{queue.name}")
      end
    end
def process(queue, job)
      start = Time.now
      finished = false
      begin
        call(job).tap do
          queue.delete(job[:id])
          finished = true
        end
      rescue => e
        handle_failure(job, e)
        finished = true
      ensure
        if !finished
          queue.unlock(job[:id])
        end
        ttp = Integer((Time.now - start) * 1000)
        QC.measure("time-to-process=#{ttp} source=#{queue.name}")
      end
    end
A job is processed by evaluating the target code.
 if the job is evaluated with no exceptions
 then it is deleted from the queue.
 If the job has raised an exception the responsibility of what
 to do with the job is delegated to Worker#handle_failure.
 If the job is not finished and an INT signal is trapped,
 this method will unlock the job in the queue.