def collect_replies(conn, channel, queue, *args, **kwargs):
 no_ack = kwargs.setdefault(u'no_ack', True)
 received = False
 try:
  for (body, message) in itermessages(conn, channel, queue, *args, **kwargs):
   if (not no_ack):
    message.ack()
   received = True
   (yield body)
 finally:
  if received:
   channel.after_reply_message_received(queue.name)

def collect_replies ( conn , channel , queue , * args , ** kwargs ) : no_ack = kwargs . setdefault ( u'no_ack' , True ) received = False try : for ( body , message ) in itermessages ( conn , channel , queue , * args , ** kwargs ) : if ( not no_ack ) : message . ack ( ) received = True ( yield body ) finally : if received : channel . after_reply_message_received ( queue . name )
generator collecting replies from queue .