New universal pubsub interface in zmq_socket.py. Needs more work.

This commit is contained in:
Nick Foster
2013-06-03 08:38:26 -04:00
parent 33874893b7
commit b71c978e27
7 changed files with 161 additions and 19 deletions

View File

@@ -27,14 +27,14 @@ from air_modes.exceptions import *
import zmq
class output_sql(air_modes.parse, threading.Thread):
def __init__(self, mypos, filename, context, addr=None):
def __init__(self, mypos, filename, context, addr=None, port=None):
threading.Thread.__init__(self)
air_modes.parse.__init__(self, mypos)
#init socket
self._subscriber = context.socket(zmq.SUB)
if addr is not None:
self._subscriber.connect("tcp://%s" % addr)
self._subscriber.connect("tcp://%s:%i" % (addr, port))
else:
self._subscriber.connect("inproc://modes-radio-pub")
self._subscriber.setsockopt(zmq.SUBSCRIBE, "dl_data")