    # File lib/amqp/queue.rb, line 461
        def pop(opts = {}, &block)
          if block
            # We have to maintain this multiple arities jazz
            # because older versions this gem are used in examples in at least 3
            # books published by O'Reilly :(. MK.
            shim = Proc.new { |method, headers, payload|
              case block.arity
              when 1 then
                block.call(payload)
              when 2 then
                h = Header.new(@channel, method, headers ? headers.decode_payload : nil)
                block.call(h, payload)
              else
                h = Header.new(@channel, method, headers ? headers.decode_payload : nil)
                block.call(h, payload, method.delivery_tag, method.redelivered, method.exchange, method.routing_key)
              end
            }

            @channel.once_open do
              # see AMQ::Client::Queue#get in amq-client
              self.get(!opts.fetch(:ack, false), &shim)
            end
          else
            @channel.once_open { self.get(!opts.fetch(:ack, false)) }
          end
        end