# Functions
No description provided by the author
NewNotifyHub creates a new hub for broadcasting events to subscribers.
# Structs
No description provided by the author
NotifyHub is responsible for broadcasting generic events to subscribers Example usage: notifyHub := hub.NewNotifyHub[string](20) go func() { sub, id := notifyHub.Subscribe() defer notifyHub.Unsubscribe(id) for payload := range sub { fmt.Printf("Received payload %#v\n", payload) } }() time.Sleep(10 * time.Millisecond) notifyHub.Broadcast("foobar") time.Sleep(10 * time.Millisecond)
Expected output: Received payload "foobar".