Versions in this module Expand all Collapse all v0 v0.1.0 Jul 15, 2026 Changes in this version + var ErrBreak = errors.New("break") + type ErrorHandler func(event string, err error) + type EventEmitter interface + AddListener func(event string, listener Listener) UnsubscribeFunc + Emit func(ctx context.Context, event string, payload any) + ListenerCount func(event string) int + Once func(event string, listener Listener) UnsubscribeFunc + RemoveAllListeners func(event string) + Use func(event string, middleware ...Middleware) + type Listener interface + Handle func(ctx context.Context, payload any) error + type ListenerFunc func(ctx context.Context, payload any) error + func (f ListenerFunc) Handle(ctx context.Context, payload any) error + type Middleware interface + Handle func(next Listener) Listener + type MiddlewareFunc func(next Listener) Listener + func (f MiddlewareFunc) Handle(next Listener) Listener + type OptOptionsSetter func(o *Options) + func WithErrorHandler(opt ErrorHandler) OptOptionsSetter + func WithStopOnError(opt bool) OptOptionsSetter + type Options struct + func NewOptions(options ...OptOptionsSetter) Options + func (o *Options) Validate() error + type SyncEventEmitter struct + func NewSync(opts Options) (*SyncEventEmitter, error) + func (e *SyncEventEmitter) AddListener(event string, listener Listener) UnsubscribeFunc + func (e *SyncEventEmitter) Emit(ctx context.Context, event string, payload any) + func (e *SyncEventEmitter) ListenerCount(event string) int + func (e *SyncEventEmitter) Once(event string, listener Listener) UnsubscribeFunc + func (e *SyncEventEmitter) RemoveAllListeners(event string) + func (e *SyncEventEmitter) Use(event string, middleware ...Middleware) + type TypedListener func(ctx context.Context, payload *T) error + type UnsubscribeFunc func() + func On[E any](ee EventEmitter, event string, handler TypedListener[E]) UnsubscribeFunc