Categorygithub.com/riverqueue/river
modulepackage
0.11.4
Repository: https://github.com/riverqueue/river.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
Package riverdriver exposes generic constructs to be implemented by specific drivers that wrap third party database packages, with the aim being to keep the main River interface decoupled from a specific database package so that other packages or other major versions of packages can be supported in future River versions.
Package rivermigrate provides a Go API for running migrations as alternative to migrating via the bundled CLI.
No description provided by the author
Package rivertest contains test assertions that can be used in a project's tests to verify that certain actions occurred from the main river package.
Package rivertype stores some of the lowest level River primitives so they can be shared amongst a number of packages including the top-level river package, database drivers, and internal utilities.

# Functions

AddWorker registers a Worker on the provided Workers bundle.
AddWorkerSafely registers a worker on the provided Workers bundle.
ClientFromContext returns the Client from the context.
ClientFromContext returns the Client from the context.
JobCancel wraps err and can be returned from a Worker's Work method to cancel the job at the end of execution.
JobCompleteTx marks the job as completed as part of transaction tx.
JobListCursorFromJob creates a JobListCursor from a JobRow.
JobSnooze can be returned from a Worker's Work method to cause the job to be tried again after the specified duration.
NewClient creates a new Client with the given database driver and configuration.
NewJobListParams creates a new JobListParams to return available jobs sorted by time in ascending order, returning 100 jobs at most.
NewPeriodicJob returns a new PeriodicJob given a schedule and a constructor function.
NewQueueListParams creates a new QueueListParams to return available jobs sorted by time in ascending order, returning 100 jobs at most.
NewWorkers initializes a new registry of available job workers.
PeriodicInterval returns a simple PeriodicSchedule that runs at the given interval.
WorkFunc wraps a function to implement the Worker interface.

# Constants

EventKindJobCancelled occurs when a job is cancelled.
EventKindJobCompleted occurs when a job is completed.
EventKindJobFailed occurs when a job fails.
EventKindJobSnoozed occurs when a job is snoozed.
EventKindQueuePaused occurs when a queue is paused.
EventKindQueueResumed occurs when a queue is resumed.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
JobListOrderByFinalizedAt specifies that the sort should be by `finalized_at`.
JobListOrderByID specifies that the sort should be by job ID.
JobListOrderByScheduledAt specifies that the sort should be by `scheduled_at`.
JobListOrderByTime specifies that the sort should be by the "best fit" time field based on listed state.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
SortOrderAsc specifies that the sort should in ascending order.
SortOrderDesc specifies that the sort should in descending order.

# Variables

No description provided by the author
ErrNotFound is returned when a query by ID does not match any existing rows.

# Structs

Client is a single isolated instance of River.
Config is the configuration for a Client.
River's default retry policy.
No description provided by the author
Event wraps an event that occurred within a River client, like a job being completed.
InsertManyParams encapsulates a single job combined with insert options for use with batch insertion.
InsertOpts are optional settings for a new job which can be provided at job insertion time.
Job represents a single unit of work, holding both the arguments and information for a job with args of type T.
JobListCursor is used to specify a starting point for a paginated job list query.
JobListParams specifies the parameters for a JobList query.
JobListResult is the result of a job list operation.
JobStatistics contains information about a single execution of a job.
PeriodicJob is a configuration for a periodic job.
PeriodicJobBundle is a bundle of currently configured periodic jobs.
PeriodicJobOpts are options for a periodic job.
QueueBundle is a bundle for adding additional queues.
QueueConfig contains queue-specific configuration.
QueueListParams specifies the parameters for a QueueList query.
QueueListResult is the result of a job list operation.
QueuePauseOpts are optional settings for pausing or resuming a queue.
SubscribeConfig is more thorough subscription configuration used for Client.SubscribeConfig.
UniqueOpts contains parameters for uniqueness for a job.
UnknownJobKindError is returned when a Client fetches and attempts to work a job that has not been registered on the Client's Workers bundle (using AddWorker).
WorkerDefaults is an empty struct that can be embedded in your worker struct to make it fulfill the Worker interface with default values.
Workers is a list of available job workers.

# Interfaces

ClientRetryPolicy is an interface that can be implemented to provide a retry policy for how River deals with failed jobs at the client level (when a worker does not define an override for `NextRetry`).
ErrorHandler provides an interface that will be invoked in case of an error or panic occurring in the job.
JobArgs is an interface that represents the arguments for a job of type T.
JobArgsWithInsertOpts is an extra interface that a job may implement on top of JobArgs to provide insertion-time options for all jobs of this type.
PeriodicSchedule is a schedule for a periodic job.
Worker is an interface that can perform a job with args of type T.

# Type aliases

EventKind is a kind of event to subscribe to from a client.
JobListOrderByField specifies the field to sort by.
PeriodicJobConstructor is a function that gets called each time the paired PeriodicSchedule is triggered.
SortOrder specifies the direction of a sort.