flux-framework / flux-core

core services for the Flux resource management framework
GNU Lesser General Public License v3.0
162 stars 49 forks source link

libflux/reactor: add flux_watcher_is_active() #2267

Open garlick opened 4 years ago

garlick commented 4 years ago

libev has ev_is_active() to check if a watcher has been started. It may be useful to have a flux_watcher_is_active(). This just came up in some work @chu11 is doing.

Chatting with @grondo, the easiest way to do this might be to track start/stop with a new flag in the flux_watcher struct.

Watchers (like timers) that can operate in one-shot mode might need further investigation though to see if that strategy can still work. If calling ev_is_active() is the only way to see if that type of watcher is active, then we might need to add a new flux_watcher_ops callback.

chu11 commented 4 years ago

Linking that this could be useful for #2235

stale[bot] commented 3 years ago

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.