Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Subscriber ¶
type Subscriber[T any] struct { // contains filtered or unexported fields }
Subscriber represents a single subscriber with a context and a channel
type Subscribers ¶
type Subscribers[T any] interface { // Push adds a new subscriber Push(ctx context.Context, ch chan<- T) // SendAll sends a message to all subscribers SendAll(message T) // CleanDone removes subscribers whose context is done CleanDone() }
Subscribers is the interface for managing subscribers of type T
func NewSubscribers ¶
func NewSubscribers[T any]() Subscribers[T]
NewSubscribers creates a new Subscribers instance
Click to show internal directories.
Click to hide internal directories.