Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
libflux: add flux_event_publish() interface #1512
This PR adds functions for "synchronous" event publication. That is, they encapsulate an event in a request message and send it as an RPC to a broker service that assigns a sequence number to it, then responds to the RPC in parallel with the event propagation.
This was added in a more ad-hoc way recently, with the
The following missing API functions were added:
/* Publish an event. * The future is fulfilled once the event has been assigned a sequence number, * and does not indicate that the event has yet reached all subscribers. */ flux_future_t *flux_event_publish (flux_t *h, const char *topic, int flags, const char *json_str); flux_future_t *flux_event_publish_pack (flux_t *h, const char *topic, int flags, const char *fmt, ...); flux_future_t *flux_event_publish_raw (flux_t *h, const char *topic, int flags, const void *data, int len); /* Obtain the event sequence number from the fulfilled * flux_event_publish() future. */ int flux_event_publish_get_seq (flux_future_t *f, int *seq);
The job module was switched from the ad-hoc
Man pages and unit tests were (minimally) updated.
@@ Coverage Diff @@ ## master #1512 +/- ## ========================================== + Coverage 78.53% 78.55% +0.02% ========================================== Files 164 165 +1 Lines 30653 30814 +161 ========================================== + Hits 24074 24207 +133 - Misses 6579 6607 +28
I was able to get coverage up by adding a lua test to send malformed requests to the new service, and by augmenting the