Versions in this module Expand all Collapse all v0 v0.2.0 May 19, 2026 Changes in this version + type Config struct + BaseBackoff time.Duration + BatchSize int + MaxAttempts int + PollInterval time.Duration + type Dispatcher struct + type Drainer struct + func NewDrainer(repo Repository, handlers map[string]Handler, monitor monitoring.Monitor, ...) *Drainer + func (d *Drainer) Drain(ctx context.Context) (int, error) + type Handler interface + Handle func(ctx context.Context, msg Message) error + type HandlerFunc func(ctx context.Context, msg Message) error + func (f HandlerFunc) Handle(ctx context.Context, msg Message) error + type Message struct + Attempts int + CreatedAt time.Time + ID string + Kind string + LastError string + Payload json.RawMessage + type MessageDraft struct + Kind string + Payload json.RawMessage + func NewDraft(kind string, payload any) (MessageDraft, error) + type Repository interface + Claim func(ctx context.Context, batch int) ([]Message, error) + Enqueue func(ctx context.Context, drafts ...MessageDraft) error + MarkDone func(ctx context.Context, id string) error + MarkFailed func(ctx context.Context, id string, handlerErr error, retryAt time.Time) error + type Worker struct + func NewWorker(repo Repository, handlers map[string]Handler, monitor monitoring.Monitor, ...) *Worker + func (w *Worker) Run(ctx context.Context) error