MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / New

Function New

chainbus/bus.go:68–75  ·  view source on GitHub ↗

New returns new ChainBus with empty handlers.

()

Source from the content-addressed store, hash-verified

66
67// New returns new ChainBus with empty handlers.
68func 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.
78func (bus *ChainBus) doSubscribe(topic string, fn interface{}, handler *eventHandler) error {

Callers 11

NewBusServiceFunction · 0.92
TestNewFunction · 0.70
TestHasCallbackFunction · 0.70
TestSubscribeFunction · 0.70
TestSubscribeOnceFunction · 0.70
TestUnsubscribeFunction · 0.70
TestPublishFunction · 0.70
TestSubcribeOnceAsyncFunction · 0.70
TestSubscribeAsyncFunction · 0.70

Calls

no outgoing calls

Tested by 10

TestNewFunction · 0.56
TestHasCallbackFunction · 0.56
TestSubscribeFunction · 0.56
TestSubscribeOnceFunction · 0.56
TestUnsubscribeFunction · 0.56
TestPublishFunction · 0.56
TestSubcribeOnceAsyncFunction · 0.56
TestSubscribeAsyncFunction · 0.56