postgres

package
v0.0.0-...-b60358c Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxPullBatchSize = 200
)

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(ctx context.Context, 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) GetFailedJobs

func (pgqueue *PostgreSQLQueue) GetFailedJobs(ctx context.Context) (jobs []queue.Job, err error)

func (*PostgreSQLQueue) GetJob

func (pgqueue *PostgreSQLQueue) GetJob(ctx context.Context, jobID guid.GUID) (job queue.Job, err error)

func (*PostgreSQLQueue) Pull

func (pgqueue *PostgreSQLQueue) Pull(ctx context.Context, numberOfJobs uint64) (ret []queue.Job, err 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) PushMany

func (pgqueue *PostgreSQLQueue) PushMany(ctx context.Context, newJobs []queue.NewJobInput) (err error)

Jump to

Keyboard shortcuts

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