statedWaitFirst( readStatedWaitMs:StatedWaitReader, inner:NonNullable< number | ((attempt:number,error:unknown)=>number) |undefined, >, ):BackoffFunction
A RetryPolicy.backoffMs function that honours a wait the outside system stated: when readStatedWaitMs(error)
answers a finite number >= 0, that is the wait; otherwise inner (a backoff function, or a fixed number of
milliseconds) decides. A reader that throws or answers anything else states nothing — a malformed Retry-After
falls back to the schedule rather than to a wrong wait. The runner still caps the stated wait at maxBackoffMs and
stops the series when it would outlast the run's deadline.
The outside system chooses this wait, and a broken or hostile one can ask for an hour: whenever the wait comes from
the server, declare the policy's maxBackoffMs (or run under a deadline).
A
RetryPolicy.backoffMsfunction that honours a wait the outside system stated: whenreadStatedWaitMs(error)answers a finite number >= 0, that is the wait; otherwiseinner(a backoff function, or a fixed number of milliseconds) decides. A reader that throws or answers anything else states nothing — a malformedRetry-Afterfalls back to the schedule rather than to a wrong wait. The runner still caps the stated wait atmaxBackoffMsand stops the series when it would outlast the run's deadline.The outside system chooses this wait, and a broken or hostile one can ask for an hour: whenever the wait comes from the server, declare the policy's
maxBackoffMs(or run under a deadline).