Fix broken msgq assumption

This commit is contained in:
Nick Foster 2013-06-03 09:29:08 -04:00
parent 9dad60303a
commit 2ace332b89
2 changed files with 4 additions and 4 deletions

View File

@ -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._async_sender = gru.msgq_runner(self._queue, self.send)
def send(self, data):
self._sender["dl_data"] = data
def send(self, msg):
self._sender["dl_data"] = msg.to_string()
@staticmethod
def add_radio_options(parser):

View File

@ -76,7 +76,7 @@ class zmq_pubsub_iface(threading.Thread):
if not self._pubaddr:
raise Exception("No publisher address 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):
return self._pubsub[key]
@ -97,10 +97,10 @@ class zmq_pubsub_iface(threading.Thread):
#snooze
time.sleep(0.1)
#one more send loop to clean up on shutdown
while not self._queue.empty():
self._pubsocket.send_multipart(self._queue.get())
self._subsocket.close()
self._pubsocket.close()
self.finished.set()