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

flux_event_[un]subscribe should return a future #1557

Closed
garlick opened this issue Jun 29, 2018 · 4 comments
Closed

flux_event_[un]subscribe should return a future #1557

garlick opened this issue Jun 29, 2018 · 4 comments
Labels

Comments

@garlick
Copy link
Member

garlick commented Jun 29, 2018

flux_event_subscribe() and flux_event_unsubscribe() hide synchronous RPCs in some cases, therefore it should be changed to return a future so that it can be used in reactive programs without blocking the reactor loop.

@garlick
Copy link
Member Author

garlick commented Jun 29, 2018

Because zeromq SUB sockets have a non-blocking subscribe/unsubscribe operation, flux_event_[un]subscribe() is wired directly to the connector operations:

struct flux_handle_ops {
    ...
    int         (*event_subscribe)(void *impl, const char *topic);
    int         (*event_unsubscribe)(void *impl, const char *topic);
}

Yet the shmem connector, currently the only connector based on zeromq sockets, is based on a PAIR socket not PUB/SUB.

These operations will need to be dropped and the API functions implemented directly in terms of the RPCs formerly hidden within the operations.

@chu11
Copy link
Member

chu11 commented Mar 4, 2020

As a round 1 refactoring/implementation, discussed having this function return a fulfilled future.

@stale
Copy link

stale bot commented Mar 4, 2021

This issue has been automatically marked as stale because it has not had activity for 365 days. It will be closed if no further activity occurs within 14 days. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 4, 2021
@garlick
Copy link
Member Author

garlick commented Aug 17, 2022

We have these now so closing.

flux_future_t *flux_event_subscribe_ex (flux_t *h,
                                        const char *topic,
                                        int flags);
flux_future_t *flux_event_unsubscribe_ex (flux_t *h,
                                          const char *topic,
                                          int flags);

@garlick garlick closed this as completed Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants