Versions in this module Expand all Collapse all v0 v0.3.0 Jul 15, 2026 Changes in this version + type HubEventHandlerHub struct + func NewHubEventHandlerHub[T any](ctx context.Context, buffer int, handlers ...EventHandler[T]) *HubEventHandlerHub[T] + func (h *HubEventHandlerHub[T]) HandleEvent(ctx context.Context, e Event[T]) v0.2.0 Jul 14, 2026 Changes in this version + func WithEchoBuffer[T any](n int) func(*Hub[T]) + type Ring struct + func NewRing[T any](n int) *Ring[T] + func (r *Ring[T]) Add(v T) + func (r *Ring[T]) Empty() bool + func (r *Ring[T]) Values() iter.Seq[T] v0.1.0 Jul 14, 2026 Changes in this version + const DefaultAttachBuffer + const DefaultCancelBuffer + const DefaultDeliveryTimeout + const DefaultSendBuffer + const DefaultShutdownTimeout + var ErrSubscriptionCancelled = errors.New("subscription cancelled") + var ErrSubscriptionDropped = errors.New("subscription dropped") + func WithAttachBuffer[T any](size int) func(*Hub[T]) + func WithCancelBuffer[T any](size int) func(*Hub[T]) + func WithCounterHandler[T any]() func(*Hub[T]) + func WithDeliveryTimeout[T any](timeout time.Duration) func(*Hub[T]) + func WithDevLogger[T any]() func(*Hub[T]) + func WithEchoEnabled[T any]() func(*Hub[T]) + func WithEventHandlerFunc[T any](fn func(context.Context, Event[T])) func(*Hub[T]) + func WithEventHandler[T any](handler EventHandler[T]) func(*Hub[T]) + func WithEventHandlers[T any](handlers ...EventHandler[T]) func(*Hub[T]) + func WithMaxDeliveryTimeouts[T any](tolerance int) func(*Subscription[T]) + func WithReceiveBuffer[T any](buffSize int) func(*Subscription[T]) + func WithSendBuffer[T any](size int) func(*Hub[T]) + func WithShutdownTimeout[T any](timeout time.Duration) func(*Hub[T]) + func WithSlogger[T any](ctx context.Context, logger *slog.Logger) func(*Hub[T]) + type CounterHandler struct + func NewCounterHandler[T any]() *CounterHandler[T] + func (s *CounterHandler[T]) HandleEvent(_ context.Context, e Event[T]) + type Counts struct + Cancellations int64 + Delivered int64 + Dropped int64 + Sent int64 + Subscriptions int64 + Timeouts int64 + Undeliverable int64 + type Event interface + Name func() EventName + type EventHandler interface + HandleEvent func(context.Context, Event[T]) + func DevLoggerHandler[T any]() EventHandler[T] + func SlogEventHandler[T any](ctx context.Context, logger *slog.Logger) EventHandler[T] + type EventHandlerFunc func(context.Context, Event[T]) + func (f EventHandlerFunc[T]) HandleEvent(ctx context.Context, e Event[T]) + type EventName string + type EvtCancelFailed struct + Err error + Sub *Subscription[T] + func (e EvtCancelFailed[T]) Name() EventName + func (e EvtCancelFailed[T]) Subscription() *Subscription[T] + type EvtCancelled struct + Sub *Subscription[T] + func (e EvtCancelled[T]) Name() EventName + func (e EvtCancelled[T]) Subscription() *Subscription[T] + type EvtDelivered struct + Msg T + func (e EvtDelivered[T]) Message() T + func (e EvtDelivered[T]) Name() EventName + type EvtDeliveryTimeout struct + Msg T + Timeout time.Duration + func (e EvtDeliveryTimeout[T]) Message() T + func (e EvtDeliveryTimeout[T]) Name() EventName + type EvtDrainCancelled struct + Remaining int + func (e EvtDrainCancelled) Name() EventName + type EvtDraining struct + Count int + func (e EvtDraining) Name() EventName + type EvtNoSubscribers struct + Msg T + func (e EvtNoSubscribers[T]) Message() T + func (e EvtNoSubscribers[T]) Name() EventName + type EvtSendContextCancelled struct + Msg T + func (e EvtSendContextCancelled[T]) Message() T + func (e EvtSendContextCancelled[T]) Name() EventName + type EvtSent struct + Msg T + func (e EvtSent[T]) Message() T + func (e EvtSent[T]) Name() EventName + type EvtShutdown struct + func (e EvtShutdown) Name() EventName + type EvtSubDropped struct + Sub *Subscription[T] + func (e EvtSubDropped[T]) Name() EventName + type EvtSubscribed struct + Sub *Subscription[T] + func (e EvtSubscribed[T]) Name() EventName + func (e EvtSubscribed[T]) Subscription() *Subscription[T] + type Gauges struct + Buffered int + Cancelling int + Queued int + Subscriptions int + Waiting int + type Hub struct + func NewHub[T any](ctx context.Context, opts ...func(*Hub[T])) *Hub[T] + func (s *Hub[T]) Broadcast(ctx context.Context, msg T) error + func (s *Hub[T]) Cancel(ctx context.Context, sub *Subscription[T]) error + func (s *Hub[T]) Stats(ctx context.Context) *Stats + func (s *Hub[T]) Subscribe(ctx context.Context, opts ...func(*Subscription[T])) (*Subscription[T], error) + type SnapshottingGuages struct + Msg T + func (e SnapshottingGuages[T]) Name() EventName + type Stats struct + Counts *Counts + Gauges *Gauges + func (s *Stats) String() string + type Subscription struct + func (s *Subscription[T]) Cancel(ctx context.Context) error + func (s *Subscription[T]) Data() <-chan T + func (s *Subscription[T]) Err() error