Warta is a Golang package for event broadcast/emitters.
Use go get
command.
go get github.com/raspiantoro/warta
func main() {
var helloTopic warta.TopicName = "hello"
helloFunc := func(fName string, lName string) {
fmt.Printf("Hello %s %s\n", fName, lName)
}
warta := warta.New()
l, err := warta.ListenCreate(helloTopic, helloFunc)
if err != nil {
panic(err)
}
defer l.Close()
warta.BroadcastClose(helloTopic, "John", "Doe")
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.