backoff

package
v0.0.0-...-ff439f2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultGenerator = MakeFibonacciGenerator(defaultUnit, defaultMax)

DefaultGenerator is fibonacci generator configured for retrying at intervals that backoff using the fibonacci sequence up to a maximum Duration of 125 milliseconds

Functions

This section is empty.

Types

type Generator

type Generator func() Next

Generator creates a channel of Durations that can be used to drive timeout logic for Consumer channels that are not in a receiving state, the func returned resets the sequence

func MakeFibonacciGenerator

func MakeFibonacciGenerator(unit, max time.Duration) Generator

MakeFibonacciGenerator creates a fibonacci generator for retrying at intervals that backoff using the fibonacci sequence up to a maximum Duration specified

func MakeFixedGenerator

func MakeFixedGenerator(d time.Duration) Generator

MakeFixedGenerator creates a fixed generator for retrying at intervals of the specified Duration

type Next

type Next func() time.Duration

Next is a function that returns the next timeout duration and internally progresses the backoff sequence

Jump to

Keyboard shortcuts

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