Closed whidbey closed 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.
Can you give an example application or test case that produces this?
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.