示例#1
0
 def init_connexions(self):
     """
     Initialise zmq sockets.
     Because this class is s Process, This method must be call in the run
      method to be hold by the correct processus.
     """
     self.context = zmq.Context()
     Connexions.init_connexions(self)
     return True
示例#2
0
 def init_connexions(self):
     """
     Initialise zmq sockets.
     Because this class is s Process, This method must be call in the run
      method to be hold by the correct processus.
     """
     Connexions.init_connexions(self)
     context = Context()
     self.sock_for_me = context.socket(REQ)
     self.sock_for_me.connect(self.sock_job_for_me_url)
     # Use a ZMQ Pool to get multichannel message
     self.poll = Poller()
     # Register sockets
     self.poll.register(self.sock_for_me, POLLIN)
     # Send READY to next_router to inform about my capacity to compute new
     # job
     self.sock_for_me.send_pyobj("READY")
     return True