retry

package
v0.8.29 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: MIT Imports: 3 Imported by: 0 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

func Retry(timeout time.Duration, f func(int) error) (err error)

Retry retries to run the given function until it returns no error. Returns an error after `timeout`. It uses an exponential backoff for retries, with a min of 10ms, max of 5 seconds and a factor of 1.5. Uses jitter to randomize sleep durations, to avoid contention. See more here: github.com/jpillora/backoff If the duration is set to 0, it run the given function once.

Types

This section is empty.

Jump to

Keyboard shortcuts

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