From 6e58de3f454cd9c812eefbb7e6b18d930847218a Mon Sep 17 00:00:00 2001 From: Andre Merzky Date: Fri, 6 Dec 2024 14:43:04 +0100 Subject: [PATCH 1/2] respond to comments --- src/radical/utils/zmq/pipe.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/radical/utils/zmq/pipe.py b/src/radical/utils/zmq/pipe.py index 31f4e2cf..6c068b76 100644 --- a/src/radical/utils/zmq/pipe.py +++ b/src/radical/utils/zmq/pipe.py @@ -50,7 +50,7 @@ def __init__(self, mode, url=None, log=None) -> None: self._url = None self._log = log self._sock = None - self._poller = zmq.Poller() + self._poller = None self._cbs = list() self._thread = None self._term = mt.Event() @@ -83,6 +83,7 @@ def _connect_push(self, url): Establish this pipe instance as sending endpoint. ''' + assert self._mode == MODE_PUSH if self._sock: raise RuntimeError('already connected at %s' % self._url) @@ -104,6 +105,8 @@ def _connect_pull(self, url): Establish this Pipe as receiving endpoint. ''' + assert self._mode == MODE_PULL + if self._sock: raise RuntimeError('already connected at %s' % self._url) @@ -115,6 +118,7 @@ def _connect_pull(self, url): else: self._url = zmq_bind(self._sock) + self._poller = zmq.Poller() self._poller.register(self._sock, zmq.POLLIN) From ae9d9c6d948141c082679145da5da46029211760 Mon Sep 17 00:00:00 2001 From: Andre Merzky Date: Fri, 6 Dec 2024 14:45:29 +0100 Subject: [PATCH 2/2] spacing --- src/radical/utils/zmq/pipe.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/radical/utils/zmq/pipe.py b/src/radical/utils/zmq/pipe.py index 6c068b76..272593ab 100644 --- a/src/radical/utils/zmq/pipe.py +++ b/src/radical/utils/zmq/pipe.py @@ -84,6 +84,7 @@ def _connect_push(self, url): ''' assert self._mode == MODE_PUSH + if self._sock: raise RuntimeError('already connected at %s' % self._url)