def wait_multi(self, channels, allowed_methods=None, timeout=None):
        """Wait for an event on a channel."""
        chanmap = dict((chan.channel_id, chan) for chan in channels)
        chanid, method_sig, args, content = self._wait_multiple(
                chanmap.keys(), allowed_methods, timeout=timeout)

        channel = chanmap[chanid]

        if content \
        and channel.auto_decode \
        and hasattr(content, 'content_encoding'):
            try:
                content.body = content.body.decode(content.content_encoding)
            except Exception:
                pass

        amqp_method = channel._METHOD_MAP.get(method_sig, None)

        if amqp_method is None:
            raise Exception('Unknown AMQP method (%d, %d)' % method_sig)

        if content is None:
            return amqp_method(channel, args)
        else:
            return amqp_method(channel, args, content)
def wait_multi ( self , channels , allowed_methods = None , timeout = None ) : chanmap = dict ( ( chan . channel_id , chan ) for chan in channels ) chanid , method_sig , args , content = self . _wait_multiple ( chanmap . keys ( ) , allowed_methods , timeout = timeout ) channel = chanmap [ chanid ] if content and channel . auto_decode and hasattr ( content , 'content_encoding' ) : try : content . body = content . body . decode ( content . content_encoding ) except Exception : pass amqp_method = channel . _METHOD_MAP . get ( method_sig , None ) if amqp_method is None : raise Exception ( 'Unknown AMQP method (%d, %d)' % method_sig ) if content is None : return amqp_method ( channel , args ) else : return amqp_method ( channel , args , content )
Wait for an event on a channel.