tweak watcher structure, add external watcher construction interface #1082
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is not intended to be merged, but just to get feedback.
Following up on @garlick's similar changes to allow creation of custom watchers outside of
reactor.c
, these changes slightly modify watcher internals and exposeflux_watcher_create
and some accessors for the opaque watcher type.However, I'm not sure if the approach goes too far, or not far enough, or if we should try something else.
The changes are pretty simple, however, highlights are:
signature
was dropped because it didn't seem like there was a feasible way to guarantee uniqueness for new and/or custom watchers.flux_watcher_ops
structure, since there should just be one global/static operations structure per "class" not per watcher. (If there is a good reason to copy in theops
structure to the watcher, I'm sorry I didn't know it)void *impl
implementation data as well as the address of the operations structureimpl
, both the return by reference argument toflux_watcher_create
and the explicitvoid * impl
argument to the watcherstart
,stop
,destroy
methods were dropped.