def receive_loop(self):
"""
This is the receive loop for zmq messages.
It is assumed that this method will be overwritten to meet the needs of the application and to handle
received messages.
:return:
"""
while True:
try:
data = self.subscriber.recv_multipart(zmq.NOBLOCK)
self.incoming_message_processing(data[0].decode(), umsgpack.unpackb(data[1]))
time.sleep(.001)
except zmq.error.Again:
time.sleep(.001)
except KeyboardInterrupt:
self.clean_up()
# noinspection PyMethodMayBeStatic
评论列表
文章目录