queue

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(pool *pgxpool.Pool, opts ...ClientCfgOpts) *river.Client[pgx.Tx]

NewClient creates a new river.Client. It uses the provided pool to connect to the database. It uses some defaults for error handling, fetch cooldown, fetch poll interval, job timeout, and logger. For a 'read only' client, omit the queue.

Types

type ClientCfgOpts

type ClientCfgOpts func(cfg *clientCfg)

func WithErrorHandler

func WithErrorHandler(handler river.ErrorHandler) ClientCfgOpts

func WithFetchCooldown

func WithFetchCooldown(cooldown time.Duration) ClientCfgOpts

func WithFetchPollInterval

func WithFetchPollInterval(interval time.Duration) ClientCfgOpts

func WithJobTimeout

func WithJobTimeout(timeout time.Duration) ClientCfgOpts

func WithLogger

func WithLogger(logger *slog.Logger) ClientCfgOpts

func WithPeriodicJobs

func WithPeriodicJobs(jobs []*river.PeriodicJob) ClientCfgOpts

func WithQueues

func WithQueues(queues map[string]river.QueueConfig) ClientCfgOpts

func WithWorkers

func WithWorkers(workers *river.Workers) ClientCfgOpts

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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