Current behaviour
The main function Publish an event1 and relative handler of event1, publish event2, but the event2 handler is not calling, and the program is not exited.
bus.Subscribe("event2", func() {
fmt.Println("event2")
})
bus.Subscribe("event1", func(bus EventBus.Bus) {
fmt.Println("event1")
time.Sleep(time.Second * 5)
bus.Publish("event2")
})
bus.Publish("event1", bus)
Further debugging
- I had seen in
subscribe we lock bus, so whenever publish already locked, and in SubscribeAsync we can't lock bus.
Is that default behaviour?
Current behaviour
The
mainfunction Publish anevent1and relative handler ofevent1, publishevent2, but theevent2handler is not calling, and the program is not exited.Further debugging
subscribewe lockbus, so whenever publish already locked, and inSubscribeAsyncwe can't lock bus.Is that default behaviour?