Documentation ¶
Index ¶
- func NewClient(pool *pgxpool.Pool, opts ...ClientCfgOpts) *river.Client[pgx.Tx]
- type ClientCfgOpts
- func WithErrorHandler(handler river.ErrorHandler) ClientCfgOpts
- func WithFetchCooldown(cooldown time.Duration) ClientCfgOpts
- func WithFetchPollInterval(interval time.Duration) ClientCfgOpts
- func WithJobTimeout(timeout time.Duration) ClientCfgOpts
- func WithLogger(logger *slog.Logger) ClientCfgOpts
- func WithPeriodicJobs(jobs []*river.PeriodicJob) ClientCfgOpts
- func WithQueues(queues map[string]river.QueueConfig) ClientCfgOpts
- func WithWorkers(workers *river.Workers) ClientCfgOpts
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
Click to show internal directories.
Click to hide internal directories.