def _send(self, outport, data): ports = self.participant.definition['outports'] print "Publishing message: %s, %s, %s" % (data,outport,ports) sys.stdout.flush() serialized = json.dumps(data) msg = haigha_Message(serialized) port = [p for p in ports if outport == p['id']][0] self._channel.basic.publish(msg, port['queue'], '') return
def _send(self, outport, data): ports = self.participant.definition['outports'] print "Publishing message: %s, %s, %s" % (data, outport, ports) sys.stdout.flush() serialized = json.dumps(data) msg = haigha_Message(serialized) port = [p for p in ports if outport == p['id']][0] self._channel.basic.publish(msg, port['queue'], '') return
def _send(self, participant, outport, data): ports = participant.definition['outports'] logger.debug("Publishing to message: %s, %s, %s" % (data, outport, ports)) serialized = json.dumps(data) msg = haigha_Message(serialized) port = [p for p in ports if outport == p['id']][0] self._channel.basic.publish(msg, port['queue'], '') return
def _send_discovery(self, channel, definition): m = { 'protocol': 'discovery', 'command': 'participant', 'payload': definition, } msg = haigha_Message(json.dumps(m)) channel.basic.publish(msg, '', 'fbp') logger.debug('sent discovery message') return
def sendParticipantDefinition(channel, d): msg = haigha_Message(json.dumps(d)) channel.basic.publish(msg, '', 'fbp') print 'sent discovery message', msg return