exponential

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2020 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DefaultRetryerMaxNumRetries = 3
	DefaultRetryerMinRetryDelay = 30 * time.Millisecond
	DefaultRetryerMaxRetryDelay = 300 * time.Second

	RetryOver = time.Duration(-1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Retryer

type Retryer struct {
	NumMaxRetries int
	MinRetryDelay time.Duration
	MaxRetryDelay time.Duration
}

func (*Retryer) Do

func (d *Retryer) Do(ctx context.Context, operation func(ctx context.Context) error, isErrorRetryable func(err error) bool) (over bool, err error)

func (Retryer) MaxRetries

func (d Retryer) MaxRetries() int

func (Retryer) NextBackOff

func (d Retryer) NextBackOff(retryCount int) time.Duration

Jump to

Keyboard shortcuts

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