asaskevich / EventBus

[Go] Lightweight eventbus with async compatibility for Go
MIT License
1.74k stars 220 forks source link

SubscribeAsync is not stable currently #18

Closed whidbey closed 8 years ago

whidbey commented 8 years ago

var ( bus = EventBus.New() )

// Pub publishes the given interface to any listeners for that interface. func Pub(topic string, data ...interface{}) { bus.Publish(topic, data...) }

// Sub subscribes to specific interfaces with the specified callback // function. func Sub(topic string, fn interface{}) error { //return bus.SubscribeAsync(topic, fn, true) return bus.Subscribe(topic,fn); }

func Sub2(topic string, fn interface{}) error { return bus.SubscribeAsync(topic, fn, true) //return bus.Subscribe(topic,fn); }

the Sub2 to subsrible event works,but when sometimes miss error,it will fault forever.

bennAH commented 8 years ago

Can you give an example application or test case that produces this?