backoff

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Strategy

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

Strategy defines how to calculate backoff time

func NewStrategy

func NewStrategy(initialDelay, maxDelay time.Duration, factor float64, backoffThreshold uint64) *Strategy

NewStrategy returns a backoff calculation strategy

func (*Strategy) Next

func (b *Strategy) Next(key interface{}) time.Duration

Next returns next backoff time of key

func (*Strategy) Reset

func (b *Strategy) Reset(key interface{}) bool

Reset backoff time for key

Jump to

Keyboard shortcuts

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