-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update EventStream (http PATCH) (#73)
* Add command to gen html for coverage * Update inflight count only if we processed event processing is skipped if we are paused/stopped. Hence check that we processed the event in the previous section before decrementing the in-flight counter * Adds a PATCH route to update event streams * Event streams could be updated while batches of events are currently being processed. The existing logic around concurrent handling of batch processing of events and any pause/stopping of event streams ensures that batch processing exits as soon as a pause/stop event is detected. This PR adds an additional context (and a cancel function) to the event stream spec so that an update to the event stream can signal all the batch processing related go routines to invoke the cancel function on the context (via select) * All fields in the event stream except the ID are allowed to be updated Addresses one of the items in: #68 * remove spurious entry added in Makefile * Use a empty struct channel to signal a cancelation, instead of ctx * Use an empty struct channel that can be closed to signal that the update of the stream is underway. The handler go routines select on the updateInterrupt ch so that they are woken up when the update is underway and can exit * The following go routines & functions react to the updateInterrupt channel - event poller, batch processor, batch dispatcher, individual process batch (Blocking and sleeps until timeout), perform webhook action (blocking and sleeps until timeout) * adds pre/post update helpers notify routines waiting on the condition variable and to reset flags respectively * adds a helper function to kick off a fresh set of go routines (used by resume and at the end of update) * Check error returned from subMgr updateStream call * Remove unused dispatcherDone bool flag * Move some calls to a defer and other PR comments adds a comment for updateInterrupt as a empty struct{} channel Signed-off-by: Vinod Damle <vinod.damle@kaleido.io>
- Loading branch information
Showing
7 changed files
with
464 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.