def listen(&block)
      return if @listening
      @listening = true

      @thread = Thread.new do
        while @listening
          message = @queue.retrieve(@poll_time)
          block.call(message) if message.present?
        end
      end
    end
def listen(&block)
      return if @listening
      @listening = true

      @thread = Thread.new do
        while @listening
          message = @queue.retrieve(@poll_time)
          block.call(message) if message.present?
        end
      end
    end
Listen for messages. This is asynchronous and returns immediately.

 @example

   queue = bisques.find_or_create_queue("my queue")
   listener = QueuedListener.new(queue)
   listener.listen do |message|
     puts "Received #{message.object}"
     message.delete
   end

   while true; sleep 1; end # Process messages forever

 @note Note that the block you give to this method is executed in a new thread.
 @yield [Message] a message received from the {Queue}