def _multi_send(method, context, topic, msg, timeout=None, envelope=False, _msg_id=None):
 conf = CONF
 LOG.debug((_('%(msg)s') % {'msg': ' '.join(map(pformat, (topic, msg)))}))
 queues = _get_matchmaker().queues(topic)
 LOG.debug(_('Sending message(s) to: %s'), queues)
 if (len(queues) == 0):
  LOG.warn(_('No matchmaker results. Not casting.'))
  raise rpc_common.Timeout(_('No match from matchmaker.'))
 for queue in queues:
  (_topic, ip_addr) = queue
  _addr = ('tcp://%s:%s' % (ip_addr, conf.rpc_zmq_port))
  if (method.__name__ == '_cast'):
   eventlet.spawn_n(method, _addr, context, _topic, msg, timeout, envelope, _msg_id)
   return
  return method(_addr, context, _topic, msg, timeout, envelope)

def _multi_send ( method , context , topic , msg , timeout = None , envelope = False , _msg_id = None ) : conf = CONF LOG . debug ( ( _ ( '%(msg)s' ) % { 'msg' : ' ' . join ( map ( pformat , ( topic , msg ) ) ) } ) ) queues = _get_matchmaker ( ) . queues ( topic ) LOG . debug ( _ ( 'Sending message(s) to: %s' ) , queues ) if ( len ( queues ) == 0 ) : LOG . warn ( _ ( 'No matchmaker results. Not casting.' ) ) raise rpc_common . Timeout ( _ ( 'No match from matchmaker.' ) ) for queue in queues : ( _topic , ip_addr ) = queue _addr = ( 'tcp://%s:%s' % ( ip_addr , conf . rpc_zmq_port ) ) if ( method . __name__ == '_cast' ) : eventlet . spawn_n ( method , _addr , context , _topic , msg , timeout , envelope , _msg_id ) return return method ( _addr , context , _topic , msg , timeout , envelope )
wraps the sending of messages .