Esempio n. 1
0
 def _serve(self):
     ctx = getZmqContext()
     self.socket = ctx.socket(zmq.PULL)
     try:
         try:
             self.socket.bind(config.get('repository', 'management-socket'))
         except zmq.ZMQError:
             self._started_event.set(False)
         else:
             self._started_event.set(True)
             while True:
                 parts = self.socket.recv_multipart()
                 handler = getattr(self, 'handle_' + parts[0], None)
                 if handler:
                     gevent.spawn(self._handle_wrapper, handler, *parts[1:])
     finally:
         self.socket.close()
Esempio n. 2
0
 def __init__(self, pevent=None, **kargs):
     super(PrintEvents, self).__init__(pevent, **kargs)
     self._socket = getZmqContext().socket(zmq.PUSH)
     self._socket.connect(config.get('repository', 'management-socket'))
Esempio n. 3
0
 def __init__(self):
     ctx = getZmqContext()
     self.socket = ctx.socket(zmq.PUSH)
     self.socket.connect(config.get('repository', 'management-socket'))