ReadonlyattemptsTotal attempts, not additional ones: 1 never retries.
ReadonlybackoffHow long to wait between them.
Optional ReadonlybudgetCeiling on retries across every call sharing it, so a failing dependency does not get several times its usual traffic.
Optional ReadonlyclockDefaults to the system clock.
Optional ReadonlymaxBudget for the whole operation, measured from the first attempt.
A retry is abandoned when its backoff would carry the call past the budget, so the last failure is reported at that point rather than waited out first. A timeout below this policy also shortens its deadline to whatever is left, so no attempt overshoots the budget it started under.
Optional ReadonlyonReceives an attempt event per try and a retry event per wait.
ReadonlyshouldWhether a failure is worth repeating, called with the error and the number of the attempt that produced it.
There is no default. Whether a rejection is worth repeating is the one thing this package cannot know (a 409 is fatal to one caller and expected by another), and a guess made here would be a guess nobody can remove. retryAnything is the answer when the layer below has already classified.
Configuration for retry.