Created
December 20, 2013 17:35
-
-
Save i-sam/8058430 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _broadcast(self, command, arguments=None, destination=None, | |
reply=False, timeout=1, limit=None, | |
callback=None, channel=None): | |
if destination is not None and \ | |
not isinstance(destination, (list, tuple)): | |
raise ValueError( | |
'destination must be a list/tuple not {0}'.format( | |
type(destination))) | |
arguments = arguments or {} | |
reply_ticket = reply and uuid() or None | |
chan = channel or self.connection.default_channel | |
# Set reply limit to number of destinations (if specified) | |
if limit is None and destination: | |
limit = destination and len(destination) or None | |
self._publish(command, arguments, destination=destination, | |
reply_ticket=reply_ticket, | |
channel=chan, | |
timeout=timeout) | |
if reply_ticket: | |
return self._collect(reply_ticket, limit=limit, | |
timeout=timeout, | |
callback=callback, | |
channel=chan) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment