Exemple #1
0
 def json_server():
     # Wait on messages
     s_json = self.context.socket(zmq.PULL)
     s_json.bind(self._options.json_bind_address)
     while True:
         msg = s_json.recv()
         q.put(util.bson_from_json(msg))
Exemple #2
0
 def json_server():
     # Wait on messages
     s_json = context.socket(zmq.PULL)
     s_json.setsockopt(zmq.HWM, HWM)
     log.info('Listening for json events at %s' % self.options.json_bind_address)
     s_json.bind(self.options.json_bind_address)
     while True:
         j_msg = s_json.recv(copy=False)
         b_msg = zmq.Message(util.bson_from_json(j_msg.buffer))
         s_outgoing.send(b_msg, copy=False)