Documentation ¶
Index ¶
- func IsAlwaysRetryable(error) bool
- func IsNeverRetryable(error) bool
- func Wait(ctx context.Context, f Func) error
- func WaitWithBackoff(ctx context.Context, b backoff.Backoff, f Func) error
- func WaitWithBackoffWithRetries(ctx context.Context, b backoff.Backoff, numRetries int, r IsRetryableFunc, ...) error
- func WaitWithRetries(ctx context.Context, numRetries int, r IsRetryableFunc, f Func) error
- type Func
- type IsRetryableFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAlwaysRetryable ¶
IsAlwaysRetryable instructs WaitWithRetries to retry until time expires.
func IsNeverRetryable ¶
IsNeverRetryable instructs WaitWithRetries not to retry.
func Wait ¶
Wait calls WaitWithBackoff with default backoff parameters. The defaults are handled by the "github.com/jpillora/backoff" and are:
min = 100 * time.Millisecond max = 10 * time.Second factor = 2 jitter = false
func WaitWithBackoff ¶
WaitWithBackoff calls a function until it returns true, an error, or until the context is done.
func WaitWithBackoffWithRetries ¶
func WaitWithBackoffWithRetries(ctx context.Context, b backoff.Backoff, numRetries int, r IsRetryableFunc, f Func) error
WaitWithBackoffWithRetries will invoke a function `f` until it returns true or the context `ctx` is done. If `f` returns an error, WaitWithBackoffWith retries will tolerate up to `numRetries` errors. If returned error is not retriable according to `r`, then it will bait out immediately. The wait time between retries will be decided by backoff parameters `b`.
func WaitWithRetries ¶
WaitWithRetries will invoke a function `f` until it returns true or the context `ctx` is done. If `f` returns an error, WaitWithRetries will tolerate up to `numRetries` errors.
Types ¶
type Func ¶
Func returns true if the condition is satisfied, or an error if the loop should be aborted.
type IsRetryableFunc ¶
IsRetryableFunc is the signature for functions that return true if we should retry an error