RetryClient.withDelays constructor
RetryClient.withDelays(})
Like RetryClient.new, but with a pre-computed list of delays
between each retry.
This will retry a request at most delays.length
times, using each delay
in order. It will wait for delays[0]
after the initial request,
delays[1]
after the first retry, and so on.
Implementation
RetryClient.withDelays(
Client inner,
Iterable<Duration> delays, {
FutureOr<bool> Function(BaseResponse) when = _defaultWhen,
FutureOr<bool> Function(Object, StackTrace) whenError = _defaultWhenError,
FutureOr<void> Function(BaseRequest, BaseResponse?, int retryCount)?
onRetry,
}) : this._withDelays(
inner,
delays.toList(),
when: when,
whenError: whenError,
onRetry: onRetry,
);