retry

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelOnContextError

func CancelOnContextError(err error) bool

CancelOnContextError returns true if provided error is a context.Canceled error or context.DeadlineExceeded error.

func ExponentialRandomBackoff

func ExponentialRandomBackoff(maxRetry uint, base time.Duration, fn func(uint) error, cancel func(error) bool) error

Retry runs the given function with a non deterministic exponential backoff until it succeed or cancel returns true.

func LinearBackoff

func LinearBackoff(maxRetry uint, base time.Duration, fn func(uint) error, cancel func(error) bool) error

Retry runs the given function with a non deterministic linear backoff until it succeed or cancel returns true.

func LinearRandomBackoff

func LinearRandomBackoff(maxRetry uint, base time.Duration, fn func(uint) error, cancel func(error) bool) error

Retry runs the given function with a non deterministic linear backoff until it succeed or cancel returns true.

func NeverCancel

func NeverCancel(_ error) bool

NeverCancel always return false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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