Skip to content

Commit 2aa8fbd

Browse files
authored
Merge pull request #11 from riptideslabs/multi-loop-fix
Remove second goroutine for channel loop in Publish and PublishSync methods
2 parents d779b39 + ff6e1e4 commit 2aa8fbd

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

eventbus.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ func (e *EventBus) Publish(topic string, payload any) error {
209209
if !ok {
210210
ch = newChannel(topic, e.bufferSize)
211211
e.channels.Store(topic, ch)
212-
go ch.(*channel).loop()
213212
}
214213

215214
return ch.(*channel).publish(payload)
@@ -224,7 +223,6 @@ func (e *EventBus) PublishSync(topic string, payload any) error {
224223
if !ok {
225224
ch = newChannel(topic, e.bufferSize)
226225
e.channels.Store(topic, ch)
227-
go ch.(*channel).loop()
228226
}
229227

230228
return ch.(*channel).publishSync(payload)

0 commit comments

Comments
 (0)