def publish(self, key, body): try: self.chan.basic_publish("thb_events", "%s:%s" % ("forum", key), Endpoint.encode(body)) except: logging.error("error publishing", exc_info=True) swallow(self.shutdown)() self.connect()
def publish(self, key, body): try: self.chan.basic_publish( 'thb_events', '%s:%s' % (options.node, key), Endpoint.encode(body), ) except: log.error('error publishing', exc_info=True) swallow(self.shutdown)() self.connect()
def publish(self, key, body): try: self.chan.basic_publish( 'thb_events', '%s:%s' % ('forum', key), Endpoint.encode(body), ) except: logging.error('error publishing', exc_info=True) swallow(self.shutdown)() self.connect()
def gwrite(self, tag, data): log.debug('GAME_WRITE: %s', repr([tag, data])) encoded = Endpoint.encode(data) self.gdhistory.append([tag, json.loads(encoded)])
def publish(self, topic, data): self.pub.publish( 'thb.{}.{}'.format(self.node, topic), Endpoint.encode(data), )