def process_queue_item      #:nodoc:
      return false if @queue.empty?

      # Even though we just asked if the queue was empty, it
      # still could have had an item which by this statement
      # is now gone. For this reason we pass true to Queue#deq
      # because we will sleep indefinitely if it is empty.
      promise = @queue.deq(true)
      stat :dequeued, item_id: promise.object_id
      promise.work
      return true

    rescue ThreadError # this means the queue is empty
      false
    end
def process_queue_item      #:nodoc:
      return false if @queue.empty?

      # Even though we just asked if the queue was empty, it
      # still could have had an item which by this statement
      # is now gone. For this reason we pass true to Queue#deq
      # because we will sleep indefinitely if it is empty.
      promise = @queue.deq(true)
      stat :dequeued, item_id: promise.object_id
      promise.work
      return true

    rescue ThreadError # this means the queue is empty
      false
    end
processes one item on the queue. Returns true if there was an
 item to process, false if there was no item