Go simple async message bus.
Contributors:
Want to contribute ? Feel free to send pull requests!
Have problems, bugs, feature ideas? We are using the github issue tracker to manage them.
package main
import (
"fmt"
"github.com/vardius/message-bus"
)
func main() {
bus := messagebus.New()
var wg sync.WaitGroup
wg.Add(2)
bus.Subscribe("topic", func(v bool) {
defer wg.Done()
fmt.Println(v)
})
bus.Subscribe("topic", func(v bool) {
defer wg.Done()
fmt.Println(v)
})
bus.Publish("topic", true)
wg.Wait()
}This package is released under the MIT license. See the complete license in the package: