Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libflux: refactor reactor/watcher implementation
Problem: the reactor and watcher implementations are unnecessarily exposed and co-mingled. Split up reactor.c, reactor.h (public), reactor_private.h into: reactor.c, reactor_private.h Only the reactor struct and implementation. Add an accessor for the ev_loop, to be used only in watcher_wrap.c watcher.c, watcher_private.h Only the watcher struct and generic "class" implementation. Add accessors to avoid exposing watcher struct details to watcher implementations. watcher_wrap.c Wrapped libev watcher implementations. These now use watcher accessors rather than directly accessing the watcher struct. A public watcher.h header is added to split out the public watcher interfaces from reactor.h. This was not strictly necessary, but reactor.h was a little busy. Users are still expected to just include <flux/core.h>. Update the zmq watcher, flux_t handle watcher, fbuf watchers, and sdbus watcher to include watcher_private.h and use watcher accessors. Replacing the inlines in reactor_private.h with actual functions in watcher.c necessitated linking some executables with src/common/libflux/watcher.lo. libev use is now localized to reactor.c and watcher_wrap.c, which should make transitioning to a new implementation somewhat easier than before. The code should also be easier to read and navigate.
- Loading branch information