]> www.average.org Git - loctrkd.git/commitdiff
rectifier: add PUB zmq socket
authorEugene Crosser <crosser@average.org>
Tue, 26 Jul 2022 16:51:06 +0000 (18:51 +0200)
committerEugene Crosser <crosser@average.org>
Tue, 26 Jul 2022 21:13:27 +0000 (23:13 +0200)
loctrkd/rectifier.py
test/common.py

index 5919cbd2bd9c69437c052eff97d75b157eb3b050..8ee75970aec030f771ec0555ba306ad68b1a3397 100644 (file)
@@ -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()
index 17fde963e448ac8a76d2ebd3d25742d91905bd8f..284ca4d10c8509606dd6879f026c07f211104f83 100644 (file)
@@ -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",