backoff

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

func Retry(attempts int, sleep time.Duration, f func() error, shouldRetry func(error) bool) error

Retry executes f up to attempts times with exponential backoff starting at sleep. It returns nil on the first successful attempt, or the last error if all attempts fail. The shouldRetry predicate decides whether a given error is retryable; if it returns false, Retry stops immediately and returns that error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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