MCPcopy Create free account

hub / github.com/cenkalti/backoff / functions

Functions85 in github.com/cenkalti/backoff

↓ 20 callersFunctionRetry
Retry attempts the operation until it succeeds, returns a Permanent error, or backoff completes. It ensures the operation is executed at least once.
retry.go:114
↓ 19 callersFunctionwithTimer
withTimer sets a custom timer for managing delays between retries.
retry.go:48
↓ 16 callersMethodIs
Is reports a match against ErrPermanent so a Permanent error can be detected with errors.Is even before Retry converts it into a RetryError.
error.go:100
↓ 13 callersFunctionWithBackOff
WithBackOff configures the backoff policy used between attempts. The default is NewExponentialBackOff. Retry calls Reset on the policy before the fir
retry.go:41
↓ 11 callersMethodError
Error returns the wrapped error's message.
error.go:93
↓ 8 callersFunctionNewExponentialBackOff
NewExponentialBackOff creates an instance of ExponentialBackOff using default values.
exponential.go:66
↓ 7 callersFunctionWithMaxElapsedTime
WithMaxElapsedTime limits the total wall-clock time spent retrying, measured from when Retry is called. When the limit is reached, Retry returns a *Re
retry.go:94
↓ 6 callersFunctionAsRetryError
AsRetryError returns the *RetryError in err's chain, or nil if there is none (including when err is nil). It is a convenience wrapper around errors.As
error.go:69
↓ 6 callersFunctionNewConstantBackOff
(d time.Duration)
backoff.go:68
↓ 6 callersFunctionRetryAfter
RetryAfter returns a RetryAfterError that tells Retry to wait the given duration before the next attempt. cause is the error that triggered the wait;
error.go:125
↓ 6 callersFunctionWithMaxTries
WithMaxTries limits the total number of attempts, not retries: WithMaxTries(1) runs the operation once and does not retry. When the limit is reached,
retry.go:65
↓ 5 callersFunctionPermanent
Permanent wraps err to signal that Retry should stop immediately instead of retrying. Retry then returns a *RetryError with Cause ErrPermanent and Las
error.go:85
↓ 4 callersMethodStop
Stop turns off a ticker. After Stop, no more ticks will be sent.
ticker.go:42
↓ 4 callersMethodStop
()
timer.go:7
↓ 3 callersFunctionNewTicker
NewTicker returns a new Ticker containing a channel that will send the time at times specified by the BackOff argument. Ticker is guaranteed to tick a
ticker.go:27
↓ 3 callersMethodNextBackOff
NextBackOff calculates the next backoff interval using the formula: Randomized interval = RetryInterval * (1 ± RandomizationFactor)
exponential.go:84
↓ 3 callersMethodNextBackOff
NextBackOff returns the duration to wait before retrying the operation, backoff.Stop to indicate that no more retries should be made. Example usage:
backoff.go:33
↓ 3 callersMethodReset
Reset the interval back to the initial retry interval and restarts the timer. Reset must be called before using b.
exponential.go:77
↓ 3 callersMethodReset
Reset to initial state.
backoff.go:36
↓ 3 callersMethodUnwrap
Unwrap returns the wrapped error.
error.go:96
↓ 3 callersFunctionassertEquals
(t *testing.T, expected, value time.Duration)
exponential_test.go:85
↓ 2 callersMethodC
()
timer.go:8
↓ 2 callersMethodStart
(duration time.Duration)
timer.go:6
↓ 2 callersFunctiongetRandomValueFromInterval
Returns a random value from the following interval: [currentInterval - randomizationFactor * currentInterval, currentInterval + randomizationFactor
exponential.go:107
↓ 1 callersMethodError
Error returns a single-line representation of the cause and last error.
error.go:57
↓ 1 callersMethodError
Error returns a string representation of the RetryAfter error.
error.go:133
↓ 1 callersMethodNextBackOff
()
backoff.go:66
↓ 1 callersFunctionWithNotify
WithNotify sets a function called after each failed attempt that will be retried. See Notify for exactly when it fires.
retry.go:56
↓ 1 callersMethodincrementCurrentInterval
Increments the current interval by multiplying it with the multiplier.
exponential.go:95
↓ 1 callersMethodrun
()
ticker.go:46
↓ 1 callersMethodsend
(tick time.Time)
ticker.go:68
↓ 1 callersFunctionsubtestNextBackOff
(t *testing.T, expectedValue time.Duration, backOffPolicy BackOff)
backoff_test.go:13
MethodC
()
retry_test.go:28
MethodC
()
retry_test.go:381
MethodC
C returns the timers channel which receives the current time when the timer fires.
timer.go:17
FunctionExampleRetry
()
example_test.go:16
FunctionExampleRetry_outcomes
()
example_test.go:67
FunctionExampleTicker
()
example_test.go:119
MethodNextBackOff
()
retry_test.go:388
MethodNextBackOff
()
backoff.go:48
MethodNextBackOff
()
backoff.go:56
MethodReset
()
retry_test.go:386
MethodReset
()
backoff.go:46
MethodReset
()
backoff.go:54
MethodReset
()
backoff.go:65
MethodStart
(duration time.Duration)
retry_test.go:18
MethodStart
(d time.Duration)
retry_test.go:370
MethodStart
Start starts the timer to fire after the given duration
timer.go:22
MethodStop
()
retry_test.go:22
MethodStop
()
retry_test.go:375
MethodStop
Stop is called when the timer is not used anymore and resources may be freed.
timer.go:31
FunctionTestBackOff
(t *testing.T)
exponential_test.go:9
FunctionTestBackOffOverflow
(t *testing.T)
exponential_test.go:53
FunctionTestBackOffRandomizedOverflow
(t *testing.T)
exponential_test.go:71
FunctionTestConstantBackOff
(t *testing.T)
backoff_test.go:22
FunctionTestGetRandomizedInterval
(t *testing.T)
exponential_test.go:41
FunctionTestIssue177
Permanent error bubbles up when WithMaxTries(1) https://github.com/cenkalti/backoff/issues/177
retry_test.go:348
FunctionTestNextBackOffMillis
(t *testing.T)
backoff_test.go:8
FunctionTestPermanent
(t *testing.T)
retry_test.go:287
FunctionTestRetry
(t *testing.T)
retry_test.go:32
FunctionTestRetryAfter
(t *testing.T)
retry_test.go:480
FunctionTestRetryAfterCarriesError
https://github.com/cenkalti/backoff/issues/184
retry_test.go:592
FunctionTestRetryAfterError
(t *testing.T)
retry_test.go:563
FunctionTestRetryAfterNegativeDuration
(t *testing.T)
retry_test.go:680
FunctionTestRetryAfterNegativeDurationWaitsZero
(t *testing.T)
retry_test.go:700
FunctionTestRetryAfterPolicyStop
(t *testing.T)
retry_test.go:512
FunctionTestRetryAfterTypedNil
(t *testing.T)
retry_test.go:538
FunctionTestRetryContext
(t *testing.T)
retry_test.go:89
FunctionTestRetryContextDeadline
(t *testing.T)
retry_test.go:393
FunctionTestRetryContextErrorIncludesOperationError
https://github.com/cenkalti/backoff/issues/181
retry_test.go:126
FunctionTestRetryElapsedTimeOverflow
(t *testing.T)
retry_test.go:644
FunctionTestRetryError
(t *testing.T)
retry_test.go:169
FunctionTestRetryErrorString
(t *testing.T)
retry_test.go:629
FunctionTestRetryMaxElapsedTimeErrorIncludesOperationError
https://github.com/cenkalti/backoff/issues/181
retry_test.go:152
FunctionTestRetryMaxTriesCount
(t *testing.T)
tries_test.go:9
FunctionTestRetryMaxTriesUnlimited
(t *testing.T)
tries_test.go:34
FunctionTestRetryNotify
(t *testing.T)
retry_test.go:413
FunctionTestRetryPermanent
(t *testing.T)
retry_test.go:213
FunctionTestRetryPermanentError
(t *testing.T)
retry_test.go:319
FunctionTestRetryWithData
(t *testing.T)
retry_test.go:59
FunctionTestTicker
(t *testing.T)
ticker_test.go:10
FunctionTestTickerStop
(t *testing.T)
ticker_test.go:49
FunctionTestTickerStopsOnBackOffStop
(t *testing.T)
ticker_test.go:60
MethodUnwrap
Unwrap returns the cause and the last operation error so both can be matched with errors.Is and errors.As.
error.go:63
MethodUnwrap
Unwrap returns the error that triggered the retry, if one was provided.
error.go:141