def _wait_for_goahead(self):
control_socket = self.context.socket(zmq.REP)
control_socket.bind(os.environ['DAUBER_CONTROL_SOCKET_URI'])
poller = zmq.Poller()
poller.register(control_socket)
timeout = 500
t_last = time.time()
while (time.time() - t_last) < timeout:
ready = dict(poller.poll(10))
if ready.get(control_socket):
control_socket.recv()
control_socket.send(b'')
break
self.socket.send_multipart(['hello', b''])
t_last = time.time()
assert (time.time() - t_last) < timeout, \
"Timed out before recieving a signal to continue"
del control_socket
评论列表
文章目录