retry With Budget
Like retryWithExponentialBackoff, but every retry (not the initial attempt) must first withdraw a token from budget -- see RetryBudget for why this matters. A successful call (whether on the first attempt or a later one) deposits a token back into the budget.
Return
The result of the successful execution
Parameters
Shared RetryBudget -- use the same instance across every call site retrying against a given downstream, so the budget reflects total system-wide retry volume for it.
The maximum number of retry attempts after the initial attempt (defaults to 3)
The initial delay before the first retry (defaults to 100 milliseconds)
The maximum delay between retries (defaults to 1 minute)
The exponential backoff factor (defaults to 2.0)
The suspend operation to execute
Throws
if the operation fails and the budget has no tokens left
the original exception, if retries are exhausted with budget still available