postgresql

package
v0.0.0-...-0941746 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrJobTypeIsNotValid          = errors.New("queue.postgresql: job type is not valid")
	ErrJobDataIsNotValid          = errors.New("queue.postgresql: job data is not valid")
	ErrJobRetryMaxIsNotValid      = errors.New("queue.postgresql: retry_max is not valid")
	ErrJobRetryDelayIsNotValid    = errors.New("queue.postgresql: retry_delay is not valid")
	ErrJobRetryStrategyIsNotValid = errors.New("queue.postgresql: retry_strategy is not valid")
	ErrJobTimeoutIsNotValid       = errors.New("queue.postgresql: timeout is not valid")
)

Functions

This section is empty.

Types

type PostgreSQLQueue

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

func NewPostgreSQLQueue

func NewPostgreSQLQueue(db db.DB, logger *slog.Logger) *PostgreSQLQueue

func (*PostgreSQLQueue) Clear

func (pgqueue *PostgreSQLQueue) Clear(ctx context.Context) error

func (*PostgreSQLQueue) DeleteJob

func (pgqueue *PostgreSQLQueue) DeleteJob(ctx context.Context, jobID guid.GUID) error

func (*PostgreSQLQueue) FailJob

func (pgqueue *PostgreSQLQueue) FailJob(ctx context.Context, job queue.Job) error

func (*PostgreSQLQueue) Pull

func (pgqueue *PostgreSQLQueue) Pull(ctx context.Context, numberOfJobs int64) ([]queue.Job, error)

pull fetches at most `number_of_jobs` from the queue.

func (*PostgreSQLQueue) Push

func (pgqueue *PostgreSQLQueue) Push(ctx context.Context, tx db.Queryer, newJob queue.NewJobInput) (err error)

func (*PostgreSQLQueue) Stop

func (pgqueue *PostgreSQLQueue) Stop(ctx context.Context)

Jump to

Keyboard shortcuts

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