Rework lidar to better support testing and listeners.

This commit is contained in:
Piv
2020-03-06 21:36:27 +10:30
parent 046d38d300
commit 8e95f91f18
4 changed files with 13 additions and 17 deletions

View File

@@ -8,12 +8,10 @@ class ZmqPubSubStreamer:
'''
def __init__(self, port):
# Should create the socket here always, since zmq is not thread safe.
# Hopefully whoever uses this is not stupid enough to create it then
# pass it into a thread.
self._socket = zmq.Context.instance().socket(zmq.PUB)
print('Starting socket with address: ' + 'tcp://*:' + str(port))
self._socket.bind("tcp://*:" + str(port))
def send_message(self, message):
'''