Remove second goroutine for channel loop in Publish and PublishSync methods

This commit is contained in:
Nandor Kracser
2025-09-04 12:47:26 +02:00
parent d779b39f70
commit ff6e1e41b5

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)