Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add callbacks to pulling end of pipe #428

Merged
merged 6 commits into from
Dec 5, 2024
Merged

Conversation

andre-merzky
Copy link
Member

@andre-merzky andre-merzky commented Dec 2, 2024

This PR adds callbacks to the pull end of a pipe. That is used in RP to efficiently implement component startup checks.

The PR also cleans up some log messages and improves thread termination.

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 64.78873% with 25 lines in your changes missing coverage. Please review.

Project coverage is 61.58%. Comparing base (2f53b82) to head (c405616).
Report is 7 commits behind head on devel.

Files with missing lines Patch % Lines
src/radical/utils/zmq/pipe.py 71.11% 13 Missing ⚠️
src/radical/utils/zmq/pubsub.py 61.11% 7 Missing ⚠️
src/radical/utils/debug.py 0.00% 3 Missing ⚠️
src/radical/utils/zmq/queue.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #428      +/-   ##
==========================================
+ Coverage   61.56%   61.58%   +0.02%     
==========================================
  Files          62       62              
  Lines        6980     7015      +35     
==========================================
+ Hits         4297     4320      +23     
- Misses       2683     2695      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@andre-merzky
Copy link
Member Author

This is ready for review now. Thanks!

self._url = None
self._log = log
self._sock = None
self._poller = zmq.Poller()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the poller: For the PUSH mode, we don't need a Poller since we are only sending messages (and the socket doesn't need to wait for incoming messages), correct?

So maybe something like this:

    if mode == MODE_PUSH:
        self._connect_push(url)
        self._poller = None 

    elif mode == MODE_PULL:
        self._connect_pull(url)
        self._poller = zmq.Poller() 

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andre-merzky, did you see this comment? I am unsure if you agree on this (it is a minor change). Besides this, the PR looks good to me.

@andre-merzky andre-merzky merged commit 13d5e69 into devel Dec 5, 2024
11 checks passed
@andre-merzky andre-merzky deleted the feature/pipe_callbacks branch December 5, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants