Ejemplo n.º 1
0
    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()
Ejemplo n.º 2
0
 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()
Ejemplo n.º 3
0
    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()
Ejemplo n.º 4
0
 def gwrite(self, tag, data):
     log.debug('GAME_WRITE: %s', repr([tag, data]))
     encoded = Endpoint.encode(data)
     self.gdhistory.append([tag, json.loads(encoded)])
Ejemplo n.º 5
0
 def publish(self, topic, data):
     self.pub.publish(
         'thb.{}.{}'.format(self.node, topic),
         Endpoint.encode(data),
     )
Ejemplo n.º 6
0
 def gwrite(self, tag, data):
     log.debug('GAME_WRITE: %s', repr([tag, data]))
     encoded = Endpoint.encode(data)
     self.gdhistory.append([tag, json.loads(encoded)])