const ( // DefaultTimeout the default timeout for the entire retry operation DefaultTimeout = time.Second * 30 // DefaultDelay the default delay between successive retry attempts DefaultDelay = time.Millisecond * 10 // DefaultConverge the default converge, requiring something to succeed one time DefaultConverge = 1 )
Do retries the given function, until there is a timeout, or until the function indicates that it has completed.
UntilSuccess retries the given function until success, timeout, or until the passed-in function returns nil.
UntilSuccessOrFail calls UntilSuccess, and fails t with Fatalf if it ends up returning an error
type Option func(cfg *config)
Option for a retry opteration.
Converge sets the number of successes in a row needed to count a success. This is useful to avoid the case where tests like `coin.Flip() == HEADS` will always return success due to random variance.
Delay sets the delay between successive retry attempts.
Timeout sets the timeout for the entire retry operation.
RetriableFunc a function that can be retried.