MCPcopy Create free account
hub / github.com/akash-network/node / NewBus

Function NewBus

pubsub/bus.go:58–70  ·  view source on GitHub ↗

NewBus runs a new bus and returns bus details

()

Source from the content-addressed store, hash-verified

56
57// NewBus runs a new bus and returns bus details
58func NewBus() Bus {
59 bus := &bus{
60 subscriptions: make(map[*bus]bool),
61 pubch: make(chan Event),
62 subch: make(chan chan<- Subscriber),
63 unsubch: make(chan *bus),
64 lc: lifecycle.New(),
65 }
66
67 go bus.run()
68
69 return bus
70}
71
72func (b *bus) Publish(ev Event) error {
73 select {

Callers 4

TestUpgradeFunction · 0.92
newValidatorFunction · 0.92
TestBusFunction · 0.92
TestCloneFunction · 0.92

Calls 1

runMethod · 0.95

Tested by 4

TestUpgradeFunction · 0.74
newValidatorFunction · 0.74
TestBusFunction · 0.74
TestCloneFunction · 0.74