MCPcopy
hub / github.com/riverqueue/river / ClientRetryPolicy

Interface ClientRetryPolicy

retry_policy.go:20–26  ·  view source on GitHub ↗

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`). Jobs are scheduled to be retried in the future up until they've reached the job's max attempts, at

Source from the content-addressed store, hash-verified

18// The ClientRetryPolicy does not have access to generics and operates on the
19// raw JobRow struct with encoded args.
20type ClientRetryPolicy interface {
21 // NextRetry calculates when the next retry for a failed job should take place
22 // given when it was last attempted and its number of attempts, or any other
23 // of the job's properties a user-configured retry policy might want to
24 // consider.
25 NextRetry(job *rivertype.JobRow) time.Time
26}
27
28// DefaultClientRetryPolicy is River's default retry policy.
29type DefaultClientRetryPolicy struct {

Callers

nothing calls this directly

Implementers 8

callbackWorkUnitinternal/maintenance/job_rescuer_test.
SimpleClientRetryPolicyinternal/maintenance/job_rescuer_test.
RetryPolicyCustominternal/riverinternaltest/retrypolicy
RetryPolicyInvalidinternal/riverinternaltest/retrypolicy
RetryPolicyNoJitterinternal/riverinternaltest/retrypolicy
RetryPolicySlowinternal/riverinternaltest/retrypolicy
customizableWorkUnitinternal/jobexecutor/job_executor_test

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…