The throttling options, as defined by createThrottle, extended with the retry budget
Optional Readonlyattempts?: numberThe maximum number of attempts per exchange; 0 means no limit; defaults to 1, that is to
a single attempt with no retries
A Middleware wrapping a Fetch implementation with one pacing every exchange and retrying transient failures
Creates a middleware pacing exchanges and retrying transient failures.
Decorates a Fetch implementation with one holding each exchange until an adaptive throttle grants it, so that a client keeps to the rate its target is willing to serve without the call sites having to coordinate. Every exchange routed through the middleware shares a single throttle, whose baseline delay adapts to what the server replies:
Retry-Afterheader field, in either the delta seconds or the HTTP date form, sets the delay outrightExchanges failing on a transient status, that is
408,429or any5xx, are retried as the throttle directs, up toattemptstimes; every other unsuccessful exchange, and the last attempt of an exhausted one, is relayed to the caller as it stands, so that status handling stays with the consumer.Retries are driven by the response status, so this middleware is to be declared after any middleware converting responses into rejections, as success does: a failure already reported as a Problem is no longer a response and is relayed to the caller without being retried.
attemptsset to0retries a transient failure indefinitely, until the exchange either succeeds or fails on a status that isn't retried.