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]))
self.board.sleep(.01)
except zmq.error.Again:
try:
self.board.sleep(.01)
except:
self.clean_up()
except KeyboardInterrupt:
self.clean_up()
# noinspection PyMethodMayBeStatic
评论列表
文章目录