From ff6e1e41b5edda4a589c0bfa8ab5c75d82b1bfa9 Mon Sep 17 00:00:00 2001 From: Nandor Kracser Date: Thu, 4 Sep 2025 12:47:26 +0200 Subject: [PATCH] Remove second goroutine for channel loop in Publish and PublishSync methods --- eventbus.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/eventbus.go b/eventbus.go index b4350d4..08da4e4 100644 --- a/eventbus.go +++ b/eventbus.go @@ -209,7 +209,6 @@ func (e *EventBus) Publish(topic string, payload any) error { if !ok { ch = newChannel(topic, e.bufferSize) e.channels.Store(topic, ch) - go ch.(*channel).loop() } return ch.(*channel).publish(payload) @@ -224,7 +223,6 @@ func (e *EventBus) PublishSync(topic string, payload any) error { if !ok { ch = newChannel(topic, e.bufferSize) e.channels.Store(topic, ch) - go ch.(*channel).loop() } return ch.(*channel).publishSync(payload)