Fix broken msgq assumption
This commit is contained in:
parent
9dad60303a
commit
2ace332b89
@ -92,8 +92,8 @@ class modes_radio (gr.top_block):
|
|||||||
self._sender = air_modes.zmq_pubsub_iface(context, subaddr=None, pubaddr="inproc://modes-radio-pub")
|
self._sender = air_modes.zmq_pubsub_iface(context, subaddr=None, pubaddr="inproc://modes-radio-pub")
|
||||||
self._async_sender = gru.msgq_runner(self._queue, self.send)
|
self._async_sender = gru.msgq_runner(self._queue, self.send)
|
||||||
|
|
||||||
def send(self, data):
|
def send(self, msg):
|
||||||
self._sender["dl_data"] = data
|
self._sender["dl_data"] = msg.to_string()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_radio_options(parser):
|
def add_radio_options(parser):
|
||||||
|
@ -76,7 +76,7 @@ class zmq_pubsub_iface(threading.Thread):
|
|||||||
if not self._pubaddr:
|
if not self._pubaddr:
|
||||||
raise Exception("No publisher address set")
|
raise Exception("No publisher address set")
|
||||||
if not self.shutdown.is_set():
|
if not self.shutdown.is_set():
|
||||||
self._queue.put([key, val.to_string()]) #TODO FIXME MSGQ
|
self._queue.put([key, val])
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
return self._pubsub[key]
|
return self._pubsub[key]
|
||||||
@ -97,10 +97,10 @@ class zmq_pubsub_iface(threading.Thread):
|
|||||||
#snooze
|
#snooze
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
|
#one more send loop to clean up on shutdown
|
||||||
while not self._queue.empty():
|
while not self._queue.empty():
|
||||||
self._pubsocket.send_multipart(self._queue.get())
|
self._pubsocket.send_multipart(self._queue.get())
|
||||||
|
|
||||||
|
|
||||||
self._subsocket.close()
|
self._subsocket.close()
|
||||||
self._pubsocket.close()
|
self._pubsocket.close()
|
||||||
self.finished.set()
|
self.finished.set()
|
||||||
|
Loading…
Reference in New Issue
Block a user