From 7782ed1b248d8343358033245dadee1aa4daeb43 Mon Sep 17 00:00:00 2001 From: joshvanl Date: Mon, 6 Jan 2025 11:20:31 +0000 Subject: [PATCH] Review comments Signed-off-by: joshvanl --- events/broadcaster/broadcaster.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/events/broadcaster/broadcaster.go b/events/broadcaster/broadcaster.go index 355e980..715dfd7 100644 --- a/events/broadcaster/broadcaster.go +++ b/events/broadcaster/broadcaster.go @@ -15,7 +15,6 @@ package broadcaster import ( "context" - "fmt" "sync" "sync/atomic" ) @@ -92,12 +91,7 @@ func (b *Broadcaster[T]) subscribe(ctx context.Context, ch chan<- T) { return case <-b.closeCh: return - case env := <-bufferedCh: - select { - case ch <- env: - case <-ctx.Done(): - case <-b.closeCh: - } + case ch <- <-bufferedCh: } } }() @@ -125,7 +119,6 @@ func (b *Broadcaster[T]) Close() { defer b.wg.Wait() b.lock.Lock() if b.closed.CompareAndSwap(false, true) { - fmt.Printf(">>HERE!!!!\n") close(b.closeCh) } b.lock.Unlock()