retrier

package
v0.5.141-dev Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrDeadlineReached retrierError = "retrier: deadline reached"
	ErrStopTrying      retrierError = "retrier: stop trying"
)
View Source
const (
	NoBackoff backoff = iota
	FixedBackoff
	ExponentialBackoff
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Retrier

type Retrier interface {
	Try(ctx context.Context, f RetrierFunc) error
}

func New

func New(minInterval time.Duration, maxAttempts uint32, b backoff) Retrier

New creates a retrier with the given minimum interval between attempts and maximum retries.

type RetrierFunc

type RetrierFunc = func() error

Jump to

Keyboard shortcuts

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