retryer

package
v0.0.0-test Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

func Retry(body func() (RetrySignal, error), maxRetries int, minDelay time.Duration, maxDelay time.Duration) error

Retry retries the provided function using exponential backoff, starting with `minDelay` between attempts, and increasing to `maxDelay` after each failure. Stops when the provided function returns `FuncComplete`, or `maxRetries` is reached.

Types

type RetrySignal

type RetrySignal = int
const (
	FuncSuccess RetrySignal = iota
	FuncFailure
	FuncComplete
	FuncError
)

Jump to

Keyboard shortcuts

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