Skip to content

Commit

Permalink
Merge pull request #430 from radical-cybertools/fix/poller_instantiation
Browse files Browse the repository at this point in the history
respond to comments
  • Loading branch information
andre-merzky authored Dec 6, 2024
2 parents 13d5e69 + ae9d9c6 commit c5221f1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/radical/utils/zmq/pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -83,6 +83,8 @@ 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)

Expand All @@ -104,6 +106,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)

Expand All @@ -115,6 +119,7 @@ def _connect_pull(self, url):
else:
self._url = zmq_bind(self._sock)

self._poller = zmq.Poller()
self._poller.register(self._sock, zmq.POLLIN)


Expand Down

0 comments on commit c5221f1

Please sign in to comment.