From 16bea55924c0ab9d035f3e99573fc49c370de231 Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Tue, 26 Jul 2022 18:51:06 +0200 Subject: [PATCH] rectifier: add PUB zmq socket --- loctrkd/rectifier.py | 3 +++ test/common.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/loctrkd/rectifier.py b/loctrkd/rectifier.py index 5919cbd..8ee7597 100644 --- a/loctrkd/rectifier.py +++ b/loctrkd/rectifier.py @@ -25,6 +25,8 @@ def runserver(conf: ConfigParser) -> None: zsub.setsockopt(zmq.SUBSCRIBE, topic(proto_name(WIFI_POSITIONING))) zpush = zctx.socket(zmq.PUSH) # type: ignore zpush.connect(conf.get("collector", "listenurl")) + zpub = zctx.socket(zmq.PUB) # type: ignore + zpub.connect(conf.get("rectifier", "publishurl")) try: while True: @@ -53,6 +55,7 @@ def runserver(conf: ConfigParser) -> None: except KeyboardInterrupt: zsub.close() + zpub.close() zpush.close() zctx.destroy() # type: ignore qry.shut() diff --git a/test/common.py b/test/common.py index 17fde96..284ca4d 100644 --- a/test/common.py +++ b/test/common.py @@ -56,6 +56,7 @@ class TestWithServers(TestCase): } self.conf["rectifier"] = { "lookaside": "opencellid", + "publishurl": "ipc://" + self.tmpfilebase + ".rect.pub", } self.conf["wsgateway"] = { "port": str(freeports[1]), @@ -101,6 +102,7 @@ class TestWithServers(TestCase): for sfx in ( "", ".pub", + ".rect.pub", ".pul", ".storage.sqlite", ".opencellid.sqlite", -- 2.39.2