# File lib/amqp/queue.rb, line 809
    def status(opts = {}, &block)
      raise ArgumentError, "AMQP::Queue#status does not make any sense without a block" unless block

      shim = Proc.new { |q, declare_ok| block.call(declare_ok.message_count, declare_ok.consumer_count) }

      @channel.once_open do
        # we do not use self.declare here to avoid caching of @passive since that will cause unexpected side-effects during automatic
        # recovery process. MK.
        @connection.send_frame(AMQ::Protocol::Queue::Declare.encode(@channel.id, @name, true, @opts[:durable], @opts[:exclusive], @opts[:auto_delete], false, @opts[:arguments]))

        self.append_callback(:declare, &shim)
        @channel.queues_awaiting_declare_ok.push(self)
      end

      self
    end