Merge pull request #11 from riptideslabs/multi-loop-fix

Remove second goroutine for channel loop in Publish and PublishSync methods
This commit is contained in:
werben
2025-09-06 11:58:46 +08:00
committed by GitHub

View File

@@ -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)