def queue_status(queue_names, timeout = nil, &blk)
      count = 0
      status = {}
      each(:connected) { |b| b.queues.each { |q| count += 1 if queue_names.include?(q.name) } }
      if count == 0
        blk.call(status) if blk
      else
        handler = CountedDeferrable.new(count, timeout)
        handler.callback { blk.call(status) if blk }
        each(:connected) do |b|
          if b.queue_status(queue_names) do |name, messages, consumers|
               (status[name] ||= {})[b.identity] = {:messages => messages, :consumers => consumers}
               handler.completed_one
             end
           else
             b.queues.each { |q| handler.completed_one if queue_names.include?(q.name) }
           end
        end
      end
      true
    end
def queue_status(queue_names, timeout = nil, &blk)
      count = 0
      status = {}
      each(:connected) { |b| b.queues.each { |q| count += 1 if queue_names.include?(q.name) } }
      if count == 0
        blk.call(status) if blk
      else
        handler = CountedDeferrable.new(count, timeout)
        handler.callback { blk.call(status) if blk }
        each(:connected) do |b|
          if b.queue_status(queue_names) do |name, messages, consumers|
               (status[name] ||= {})[b.identity] = {:messages => messages, :consumers => consumers}
               handler.completed_one
             end
           else
             b.queues.each { |q| handler.completed_one if queue_names.include?(q.name) }
           end
        end
      end
      true
    end
Check status of specified queues for connected brokers
 Silently ignore unknown queues
 If a queue whose status is being checked does not exist,
 the associated broker connection will fail and be unusable

 === Parameters
 queue_names(Array):: Names of queues previously subscribed to that are to be checked
 timeout(Integer):: Number of seconds to wait for all status checks, defaults to no timeout

 === Block
 Optional block to be called after all queue statuses are obtained with hash parameter
 containing statuses with queue name as key and value that is a hash with broker identity
 as key and hash of :messages and :consumers as value; the :messages and :consumers
 values are nil if there is a failure retrieving them for the given queue

 === Return
 true:: Always return true