diff options
author | Christian Pointner <equinox@spreadspace.org> | 2019-02-10 16:13:15 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2019-02-10 16:13:15 +0100 |
commit | e6358bf625f11386f899d852664932a650c1f467 (patch) | |
tree | 19268abd1cb90218b2813ec243f2b6544245ada8 | |
parent | some more go vet fixes (diff) |
mixer: closer subscriber channel on unsubscribe
-rw-r--r-- | pkg/mixer/mixer.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/mixer/mixer.go b/pkg/mixer/mixer.go index c774342..4db2c3a 100644 --- a/pkg/mixer/mixer.go +++ b/pkg/mixer/mixer.go @@ -26,6 +26,7 @@ import ( "container/list" "errors" "fmt" + // "log" "strings" "github.com/scgolang/midi" @@ -126,6 +127,8 @@ func (m *Mixer) sendEvent(ev Event) { case ch <- ev: default: // subscriber is not respoding... + // log.Printf("mixer: removing subscriber '%v', because it is not responding", ch) + close(ch) subs.Remove(sub) } } @@ -214,5 +217,6 @@ func (m *Mixer) Subscribe(ch Channel, out chan<- Event) { m.subscribers[ch] = subs } + // log.Printf("mixer: subscribing '%v' to events for channel: %v", out, ch) subs.PushBack(out) } |