lib/queue_classic/worker.rb
def lock_job
      log(:at => "lock_job")
      job = nil
      while @running
        @queues.each do |queue|
          if job = queue.lock
            return [queue, job]
          end
        end
        @conn_adapter.wait(@wait_interval, *@queues.map {|q| q.name})
      end
    end
def lock_job
      log(:at => "lock_job")
      job = nil
      while @running
        @queues.each do |queue|
          if job = queue.lock
            return [queue, job]
          end
        end
        @conn_adapter.wait(@wait_interval, *@queues.map {|q| q.name})
      end
    end
Attempt to lock a job in the queue's table.
 If a job can be locked, this method returns an array with
 2 elements. The first element is the queue from which the job was locked
 and the second is a hash representation of the job.
 If a job is returned, its locked_at column has been set in the
 job's row. It is the caller's responsibility to delete the job row
 from the table when the job is complete.