In case of heavy load notifier created too many goroutines for sending events thus consuming a lot of resources.
Adding a single goroutine with a channel will limit usage of resources and allow events to get queued to be sent instead of trying to send everything at once.
Changeset
Added a single goroutine as a default strategy for the async delivery. On failure events are dropped.
Goroutine has two ways of handling graceful shutdown. Either react to a signal which it's registered to or react to main program context sending Done().
Added configuration option for passing MainProgramContext.
Goal
In case of heavy load notifier created too many goroutines for sending events thus consuming a lot of resources. Adding a single goroutine with a channel will limit usage of resources and allow events to get queued to be sent instead of trying to send everything at once.
Changeset
Added a single goroutine as a default strategy for the async delivery. On failure events are dropped. Goroutine has two ways of handling graceful shutdown. Either react to a signal which it's registered to or react to main program context sending
Done()
. Added configuration option for passing MainProgramContext.Testing
Existing maze-runner tests can be used