New returns new ChainBus with empty handlers.
()
| 66 | |
| 67 | // New returns new ChainBus with empty handlers. |
| 68 | func New() Bus { |
| 69 | b := &ChainBus{ |
| 70 | handlers: make(map[string][]*eventHandler), |
| 71 | lock: sync.Mutex{}, |
| 72 | wg: sync.WaitGroup{}, |
| 73 | } |
| 74 | return b |
| 75 | } |
| 76 | |
| 77 | // doSubscribe handles the subscription logic and is utilized by the public Subscribe functions. |
| 78 | func (bus *ChainBus) doSubscribe(topic string, fn interface{}, handler *eventHandler) error { |
no outgoing calls