#include <flux/core.h> typedef void (*flux_watcher_f)(flux_reactor_t *r, flux_watcher_t *w, int revents, void *arg); flux_watcher_t *flux_handle_watcher_create (flux_reactor_t *r, flux_t *h, int events, flux_watcher_f callback, void *arg); flux_t *flux_handle_watcher_get_flux (flux_watcher_t *w);
Link with -lflux-core.
flux_handle_watcher_create() creates a
which monitors for events on a Flux broker handle
h. When events occur,
callback is invoked.
revents arguments are a bitmask containing a
logical OR of the following bits. If a bit is set in
it indicates interest in this type of event. If a bit is set in
it indicates that this event has occurred.
The handle is ready for reading.
The handle is ready for writing.
The handle has encountered an error. This bit is ignored if it is set in
Events are processed in a level-triggered manner. That is, the callback will continue to be invoked as long as the event has not been fully consumed or cleared, and the watcher has not been stopped.
flux_handle_watcher_get_flux() is used to obtain the handle from
within the callback.
flux_handle_watcher_create() returns a
on success. On error, NULL is returned, and errno is set appropriately.
flux_handle_watcher_get_flux() returns the handle associated with
Out of memory.