Documentation
¶
Index ¶
- type Action
- type Callback
- type Event
- type Manager
- func (m *Manager[T]) Call(v T)
- func (m *Manager[T]) Deregister(c *Callback[T]) *Callback[T]
- func (m *Manager[T]) Map() map[*Callback[T]]bool
- func (m *Manager[T]) Once(action Action[T]) *Callback[T]
- func (m *Manager[T]) Recurring(action Action[T]) *Callback[T]
- func (m *Manager[T]) Register(c *Callback[T]) *Callback[T]
- func (m *Manager[T]) Reset()
- func (m *Manager[T]) SleepUntilDisabled(action Action[T]) *Callback[T]
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 manages the lifecycle of a collection of generic Callback structs.
func (*Manager[T]) Call ¶
func (m *Manager[T]) Call(v T)
Call fans out Event objects across all callbacks in the map.
func (*Manager[T]) Deregister ¶
Reregister removes a Callback struct from the map.
func (*Manager[T]) Once ¶
Once adds a Callback to the map that is deregistered after first execution.
Click to show internal directories.
Click to hide internal directories.