Versions in this module Expand all Collapse all v0 v0.2.0 Jul 16, 2026 Changes in this version + func SetTestQuotaNow(fn func() int64) + func TotalRetries() int64 + type Broker struct + func New(dialect Dialect, db *sql.DB, cfg Config) *Broker + func (b *Broker) Ack(ctx context.Context, id, leaseToken string, result []byte) error + func (b *Broker) Cancel(ctx context.Context, id string) error + func (b *Broker) Close() error + func (b *Broker) Counts(ctx context.Context) (map[string]map[taskgate.Status]int64, error) + func (b *Broker) Dequeue(ctx context.Context, queues []string) (*taskgate.Task, error) + func (b *Broker) Enqueue(ctx context.Context, t *taskgate.Task) error + func (b *Broker) Fail(ctx context.Context, id, leaseToken, errMsg string, kind taskgate.FailKind, ...) error + func (b *Broker) FinishCanceled(ctx context.Context, id, leaseToken string) error + func (b *Broker) Get(ctx context.Context, id string) (*taskgate.Task, error) + func (b *Broker) Heartbeat(ctx context.Context, id, leaseToken string) error + func (b *Broker) Init(opts taskgate.BrokerOptions) error + func (b *Broker) List(ctx context.Context, f taskgate.Filter) ([]*taskgate.Task, error) + func (b *Broker) QueueLen(ctx context.Context, queue string) (int, error) + func (b *Broker) QueueQuota(queue string, qc taskgate.QueueConfig) (taskgate.QuotaGate, error) + func (b *Broker) ReapExpired(ctx context.Context) (int, error) + func (b *Broker) Replay(ctx context.Context, req taskgate.ReplayRequest) (*taskgate.Task, error) + func (b *Broker) Requeue(ctx context.Context, id, leaseToken string) error + type Config struct + MaxOpenConns int + MaxTxRetry int + PollInterval time.Duration + TablePrefix string + type Dialect interface + DuplicateKeyConstraint func(err error) string + IsDuplicateKey func(err error) bool + IsIdempotentDDLErr func(err error) bool + Lock func(ctx context.Context, conn *sql.Conn, key string) error + Name func() string + QuotaSQL func(prefix string) QuotaSQL + Rebind func(query string) string + Retryable func(err error) RetryClass + SchemaSQL func(prefix string) []string + Unlock func(ctx context.Context, conn *sql.Conn, key string) error + type QuotaSQL struct + Now string + Reserve string + Upsert string + type RetryClass int + const NotRetryable + const RetryImmediate + const RetryLimited