-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The polling architecture with 200 ms sleep in ProcessEventMessages() has two drawbacks: - it imposes a rate limit of 5 events per second for any input source - it imposes an average latency of 100 ms per event The polling loop can be avoided using a goroutine per worker that posts incoming events to the `messageStream` channel, and pending on that channel in ProcessEventMessages(). A short `messageStream` queue guarantees fairness: no worker's latest event will be postponed for more than the length of the channel. Signed-off-by: Jeff Learman <[email protected]>
- Loading branch information
Showing
1 changed file
with
27 additions
and
44 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