Versions in this module Expand all Collapse all v0 v0.1.0 Jan 19, 2026 Changes in this version + func MigrateUp(pool *pgxpool.Pool) error + type DB interface + BeginTx func(ctx context.Context, options pgx.TxOptions) (pgx.Tx, error) + type EnqueueHandler func(ctx JobEnqueueContext) error + type EnqueueOption func(*enqueueConfig) + func WithMaxRetries(n int32) EnqueueOption + func WithRetryPolicy(policy RetryPolicy) EnqueueOption + type Job struct + Args T + ID int32 + Metadata map[string]any + type JobEnqueueContext struct + Args any + Metadata map[string]any + func (ectx JobEnqueueContext) WithContext(ctx context.Context) JobEnqueueContext + type JobProcessContext struct + Args any + JobID int32 + Metadata map[string]any + func (pctx JobProcessContext) WithContext(ctx context.Context) JobProcessContext + type JobQueue struct + func New[T any](db DB, worker Worker[T], opts ...JobQueueOption) *JobQueue[T] + func (jq *JobQueue[T]) Enqueue(ctx context.Context, args T, opts ...EnqueueOption) (*Job[T], error) + func (jq *JobQueue[T]) Receive(ctx context.Context) + type JobQueueOption func(*jobQueueConfig) + func WithBaseRetryDelay(d time.Duration) JobQueueOption + func WithDLQ(queueName string) JobQueueOption + func WithFIFO(isFIFO bool) JobQueueOption + func WithLogger(logger *slog.Logger) JobQueueOption + func WithMaxRetryDelay(d time.Duration) JobQueueOption + func WithMiddlewares(mws ...Middleware) JobQueueOption + func WithPollInterval(interval time.Duration) JobQueueOption + func WithQueueName(name string) JobQueueOption + type Middleware interface + Enqueue func(next EnqueueHandler) EnqueueHandler + Process func(next ProcessHandler) ProcessHandler + type ProcessHandler func(ctx JobProcessContext) error + type Querier interface + WithTx func(tx pgx.Tx) *database.Queries + type RetryPolicy int + const RetryPolicyConstant + const RetryPolicyExponential + const RetryPolicyLinear + type UnimplementedMiddleware struct + func (m *UnimplementedMiddleware) Enqueue(next EnqueueHandler) EnqueueHandler + func (m *UnimplementedMiddleware) Process(next ProcessHandler) ProcessHandler + type Worker interface + Work func(ctx context.Context, job *Job[T]) error