Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager[T any] struct { // contains filtered or unexported fields }
Manager is a subscription manager - allows for thread-safe registering/unregistering subscribers of type T
func NewManager ¶
NewManager creates a new subscription manager
func (*Manager[T]) Subscribe ¶
func (m *Manager[T]) Subscribe(subscriber T) func()
Subscribe adds a new subscriber, returns an unsubscribe function
func (*Manager[T]) Subscribers ¶
func (m *Manager[T]) Subscribers() []T
Subscribers returns a list of all subscribers
Click to show internal directories.
Click to hide internal directories.