Versions in this module Expand all Collapse all v0 v0.10.0 Nov 20, 2026 v0.9.0 Nov 15, 2026 Changes in this version type Option + func SkipWriters(names ...string) Option v0.8.2 Nov 14, 2026 v0.8.1 Nov 13, 2026 v0.8.0 Nov 13, 2026 v0.7.0 Nov 8, 2026 Changes in this version type Change + Epoch uint64 type Event + Epoch uint64 v0.6.0 Nov 3, 2026 v0.5.0 Nov 1, 2026 v0.4.1 Oct 31, 2026 v0.4.0 Oct 31, 2026 v0.3.0 Oct 29, 2026 v0.2.0 Oct 24, 2026 v0.1.0 Sep 25, 2026 Changes in this version + var ErrLeaseHeld = errors.New("effects: another drainer holds the lease for this consumer and workspace") + func On[T proto.Message](rt *Runtime, name string, fn func(context.Context, Event[T]) error, ...) error + type Change struct + Actor storage.Actor + After proto.Message + Before proto.Message + Changed []string + Deleted bool + Entity string + FirstSeen bool + Key string + Seq uint64 + Workspace string + type Config struct + BatchSize int + HealthRetention int + Interval time.Duration + Logger *slog.Logger + MeterProvider metric.MeterProvider + OnHealth func(Health) + RetryMax time.Duration + RetryMin time.Duration + Server *server.Server + TracerProvider trace.TracerProvider + Workers int + Workspaces func(ctx context.Context) ([]string, error) + type Event struct + Actor storage.Actor + After T + Before T + Changed []string + Deleted bool + Entity string + FirstSeen bool + Key string + Seq uint64 + Workspace string + func (e Event[T]) DidChange(field string) bool + type Health struct + ConsecutiveFailures int + Consumer string + Head uint64 + LastAttempt time.Time + LastError error + LastSuccess time.Time + NextAttempt time.Time + Position uint64 + WorkspaceID string + func (h Health) Lag() uint64 + type Option func(*registration) + func Watch(fields ...string) Option + type Runtime struct + func New(cfg Config) (*Runtime, error) + func (rt *Runtime) Close() error + func (rt *Runtime) Drain(ctx context.Context, consumer, workspaceID string) error + func (rt *Runtime) Health(consumer, workspaceID string) (Health, bool) + func (rt *Runtime) HealthAll() []Health + func (rt *Runtime) Kick(workspaceID string) + func (rt *Runtime) Register(name string, sink Sink, entities ...proto.Message) error + func (rt *Runtime) Start(ctx context.Context) error + func (rt *Runtime) Tracked() int + type Sink interface + Deliver func(ctx context.Context, ch Change) error + type SinkFunc func(ctx context.Context, ch Change) error + func (f SinkFunc) Deliver(ctx context.Context, ch Change) error