Documentation
¶
Overview ¶
Package typevent provides type safe event channels.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel[E Event] interface { // Emit emits an event of type E on the channel. Emit(E) error // Subscribe registers a handler for events of type E on the channel. Subscribe(ctx context.Context, handler Handler[E]) (Subscription, error) }
Channel is an event channel that can emit and subscribe to events of a specific type.
See [typevent.redis.NewChannel] for an example implementation.
type Subscription ¶
type Subscription interface { // Close unsubscribes from the channel. Close() error }
Subscription is a subscription to an event channel.
Click to show internal directories.
Click to hide internal directories.