retry

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package retry describes expected backpressure independently of a job runner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RetryAfter

func RetryAfter(value string, now time.Time) time.Duration

RetryAfter accepts both HTTP forms and never shortens the server's wait.

func Transient added in v0.2.11

func Transient(err error) bool

Transient recognizes only known upstream failures. Every independent joined cause must qualify, so a simultaneous database/programming failure stays loud. Callers must separately check their parent context and remaining retry budget.

func Upstream added in v0.2.11

func Upstream(status int, cause error) error

Upstream marks a failed HTTP attempt whose server error can recover on retry. It preserves the original error and does not change the queue's retry budget.

func Wait

func Wait(ctx context.Context, delay time.Duration) error

Types

type Deferred

type Deferred struct {
	Operation string
	Reason    string
	After     time.Duration
}

Deferred means admission control asked us to wait. It is not a failed operation, and a queue must reschedule it without consuming failure attempts.

func Deferral

func Deferral(err error) (*Deferred, bool)

Deferral recognizes wrapped delays only when every error leaf is a Deferred. An independent joined failure must retain normal retry and error reporting.

func (*Deferred) Error

func (e *Deferred) Error() string

Jump to

Keyboard shortcuts

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