Versions in this module Expand all Collapse all v0 v0.0.1 Nov 10, 2025 Changes in this version + type Backoff func(attempt int) time.Duration + func Exponential(base time.Duration, factor float64, max time.Duration) Backoff + type Envelope struct + CreatedAt time.Time + ID int64 + Key *string + Payload json.RawMessage + RetryCount int + Topic string + func (e Envelope) Decode(dest any) error + type Executor interface + ExecContext func(ctx context.Context, query string, args ...any) (sql.Result, error) + type Hooks interface + OnClaim func(ctx context.Context, batchSize int, claimed int) + OnCycle func(ctx context.Context, duration time.Duration) + OnFail func(ctx context.Context, env Envelope, attempts int, err error) + OnRetry func(ctx context.Context, env Envelope, nextAttempt int, delay time.Duration) + OnSendFailure func(ctx context.Context, env Envelope, err error) + OnSendSuccess func(ctx context.Context, env Envelope) + OnStoreError func(ctx context.Context, op string, id int64, err error) + type Logger interface + Error func(ctx context.Context, format string, v ...any) + Info func(ctx context.Context, format string, v ...any) + Warn func(ctx context.Context, format string, v ...any) + type Message struct + Body any + Key string + Topic string + func (m Message) MarshalPayload() ([]byte, error) + type Options struct + Backoff Backoff + BatchSize int + Hooks Hooks + LeaseTTL time.Duration + Logger Logger + MaxAttempts int + Now func() time.Time + PollInterval time.Duration + WorkerID string + type Relay struct + func NewRelay(store Store, sender Sender, opts Options) *Relay + func (r *Relay) Run(ctx context.Context) error + type Sender interface + Send func(ctx context.Context, msg Envelope) error + type Store interface + Add func(ctx context.Context, exec Executor, msg Message) error + Claim func(ctx context.Context, workerID string, limit int, leaseTTL time.Duration) ([]Envelope, error) + Fail func(ctx context.Context, id int64, retryCount int) error + Retry func(ctx context.Context, id int64, retryCount int, nextRetry time.Time) error + Send func(ctx context.Context, id int64, sendAt time.Time) error