Unverified Commit eba5eb07 authored by Nick Ethier's avatar Nick Ethier
Browse files

drivers/shared: added func comment to eventer

parent 387acd84
Showing with 3 additions and 1 deletion
+3 -1
...@@ -65,7 +65,7 @@ func (e *Eventer) eventLoop() { ...@@ -65,7 +65,7 @@ func (e *Eventer) eventLoop() {
for { for {
select { select {
case <-e.ctx.Done(): case <-e.ctx.Done():
e.logger.Debug("task event loop shutdown") e.logger.Trace("task event loop shutdown")
return return
case event := <-e.events: case event := <-e.events:
e.iterateConsumers(event) e.iterateConsumers(event)
...@@ -75,6 +75,8 @@ func (e *Eventer) eventLoop() { ...@@ -75,6 +75,8 @@ func (e *Eventer) eventLoop() {
} }
} }
// iterateConsumers will iterate through all consumers and broadcast the event,
// cleaning up any consumers that have closed their context
func (e *Eventer) iterateConsumers(event *drivers.TaskEvent) { func (e *Eventer) iterateConsumers(event *drivers.TaskEvent) {
e.consumersLock.Lock() e.consumersLock.Lock()
filtered := e.consumers[:0] filtered := e.consumers[:0]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment