dlq

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package dlq provides the Dead Letter Queue (DLQ) interface for handling failed jobs. DLQ implementations can store failed jobs for later inspection, retry, or cleanup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DLQAdapter

type DLQAdapter interface {
	// Push adds a failed job to the dead letter queue along with its error information.
	// The context can be used for cancellation and timeout control.
	// The job parameter contains the failed job and its processing context.
	// The err parameter contains the error that caused the job to fail.
	//
	// Returns an error if the job cannot be added to the DLQ.
	Push(ctx context.Context, job *job.JobContext, err error) error
}

DLQAdapter defines the interface for Dead Letter Queue implementations. A DLQ stores jobs that have failed processing after exhausting all retry attempts. This allows for manual inspection, debugging, and potential reprocessing of failed jobs.

type MySQLDLQ

type MySQLDLQ struct {
	// contains filtered or unexported fields
}

MySQLDLQ implements the DLQ interface using a MySQL database

func NewMySQLDLQ

func NewMySQLDLQ(db *sql.DB, logger logger.Logger) *MySQLDLQ

NewMySQLDLQ creates a new MySQL Dead Letter Queue

func (*MySQLDLQ) Push

func (m *MySQLDLQ) Push(ctx context.Context, job *job.JobContext, err error) error

Push adds a failed job to the dead letter queue

type PostgresDLQ

type PostgresDLQ struct {
	// contains filtered or unexported fields
}

PostgresDLQ implements the DLQ interface using a PostgreSQL database

func NewPostgresDLQ

func NewPostgresDLQ(db *sql.DB, logger logger.Logger) *PostgresDLQ

NewPostgresDLQ creates a new PostgreSQL Dead Letter Queue

func (*PostgresDLQ) Push

func (p *PostgresDLQ) Push(ctx context.Context, job *job.JobContext, err error) error

Push adds a failed job to the dead letter queue and deletes it from the jobs table

type RedisDLQ

type RedisDLQ struct {
	// contains filtered or unexported fields
}

func NewRedisDLQ

func NewRedisDLQ(client *redis.Client, logger logger.Logger) *RedisDLQ

func (*RedisDLQ) Push

func (r *RedisDLQ) Push(ctx context.Context, job *job.JobContext, err error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL