backoff

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backoff

type Backoff interface {
	Duration(ctx context.Context) <-chan time.Duration
	Reset()
}

type Exponential

type Exponential struct {
	// contains filtered or unexported fields
}

Exponential implements the exponential backoff as defined by [this wikipedia article](https://en.wikipedia.org/wiki/Exponential_backoff). More specifically a homebrew version based on the IPBA algorithm from [Intelligent Paging Backoff Algorithm for IEEE 802.11 MAC Protocol](https://www.researchgate.net/figure/IPBA-algorithm-description_fig6_258402123)

func NewExponentialBackoff

func NewExponentialBackoff(interval time.Duration) *Exponential

func (*Exponential) Duration

func (e *Exponential) Duration(ctx context.Context) <-chan time.Duration

func (*Exponential) Reset

func (e *Exponential) Reset()

type Immediate

type Immediate struct{}

func NewImmediate

func NewImmediate() *Immediate

func (Immediate) Duration

func (i Immediate) Duration(ctx context.Context) <-chan time.Duration

func (Immediate) Reset

func (i Immediate) Reset()

type Linear

type Linear struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewLinear

func NewLinear(interval time.Duration) *Linear

func (*Linear) Duration

func (l *Linear) Duration(ctx context.Context) <-chan time.Duration

func (*Linear) Reset

func (l *Linear) Reset()

Jump to

Keyboard shortcuts

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