go-sendaround

A wrapper around a list of callback functions to be called when data is
published to named subscription lists.
Usage
Example
package main
import (
"fmt"
"time"
"fmac.dev/go-sendaround"
)
func main() {
sendaround.Init()
sendaround.Sub("chan_1", func(data interface{}) {
fmt.Println(data)
})
sendaround.Sub("chan_2", func(data interface{}) {
fmt.Println(data)
})
sendaround.Sub("chan_2", func(data interface{}) {
fmt.Println(data)
})
sendaround.Pub("chan_1", 123)
sendaround.Pub("chan_2", struct{ greet string }{"hi!"})
time.Sleep(time.Millisecond)
}
$ go build main.go && ./main
{hi!}
123
{hi!}