exponentialbackoff

package
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package exponentialbackoff contains logic for implementing exponential backoff for GoRoutineMap and NestedPendingOperations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExponentialBackoff

func IsExponentialBackoff(err error) bool

IsExponentialBackoff returns true if an error returned from GoroutineMap indicates that a new operation can not be started because exponentialBackOffOnError is enabled and a previous operation with the same operation failed within the durationBeforeRetry period.

func NewExponentialBackoffError

func NewExponentialBackoffError(
	operationName string, expBackoff ExponentialBackoff) error

NewExponentialBackoffError returns a new instance of ExponentialBackoff error.

Types

type ExponentialBackoff

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

ExponentialBackoff contains the last occurrence of an error and the duration that retries are not permitted.

func (*ExponentialBackoff) GenerateNoRetriesPermittedMsg

func (expBackoff *ExponentialBackoff) GenerateNoRetriesPermittedMsg(operationName string) string

func (*ExponentialBackoff) SafeToRetry

func (expBackoff *ExponentialBackoff) SafeToRetry(operationName string) error

SafeToRetry returns an error if the durationBeforeRetry period for the given lastErrorTime has not yet expired. Otherwise it returns nil.

func (*ExponentialBackoff) Update

func (expBackoff *ExponentialBackoff) Update(err *error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL