Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWorkerClient ¶
Types ¶
type IEnqueuer ¶
type IEnqueuer interface {
Enqueue(ctx context.Context, args jobArgs) error
// EnqueueAt queues the job to run no earlier than at (a time not in the future runs it now).
EnqueueAt(ctx context.Context, args jobArgs, at time.Time) error
// EnqueueUniqueAt is EnqueueAt that skips the job while an equal one (by the fields tagged `river:"unique"`,
// else all args) is still queued or running. River requires running among the unique states, so a job that
// queues its own successor must differ from itself in a unique field (e.g. an attempt counter).
EnqueueUniqueAt(ctx context.Context, args jobArgs, at time.Time) error
}
IEnqueuer is the interface for enqueuing jobs into the River queue. It is used by the use-case layer to enqueue jobs without depending on the River implementation.
func NewEnqueuer ¶
func NewEnqueuer() IEnqueuer
NewEnqueuer returns a no-op IEnqueuer suitable for unit tests where the enqueue code path is never exercised (ProcessNotification never enqueues).
type IEnqueuerFactory ¶
type IEnqueuerFactory interface {
NewEnqueuer() IEnqueuer
}
type Retention ¶
type Retention struct {
// Completed is how long a job that succeeded stays.
Completed time.Duration
// Failed is how long a cancelled or discarded job stays.
Failed time.Duration
}
Retention is how long River keeps finished jobs. The arguments of a job carry what the job needs (an address, a name, a link), so a finished job is not kept longer than its failure can be looked at; zero keeps River's own default.
Click to show internal directories.
Click to hide internal directories.