Documentation
¶
Overview ¶
Package events implements the in-process Event Bus. Modules publish events after completing a state change. The bus fans out to all subscribers asynchronously via a bounded worker pool. Publish never blocks the caller — if the channel is full, the event is dropped and logged.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bus ¶
type Bus interface {
// Publish emits an event to all registered subscribers.
// It is non-blocking: the event is queued and processed asynchronously.
Publish(ctx context.Context, event domain.Event)
// Subscribe registers a handler for a specific event type.
// Returns an unsubscribe function that removes the handler.
Subscribe(eventType domain.EventType, handler HandlerFunc) (unsubscribe func())
}
Bus is the in-process publish/subscribe event bus.
Click to show internal directories.
Click to hide internal directories.