pooledRetry<R> method

Future<R> pooledRetry<R>(
  1. Pool pool,
  2. FutureOr<R> fn(), {
  3. RetryOptions? retryOptions,
})
inherited

Makes a call using a Pool whith retry semantics in case of error

  • pool: The Pool
  • fn: The delegate to run in the Pool
  • retryOptions: The RetryOptions for this call

Returns a Future for the completion of the delegate

Implementation

Future<R> pooledRetry<R>(Pool pool, FutureOr<R> Function() fn,
    {RetryOptions? retryOptions}) {
  return pooled(
      pool,
      () => (retryOptions ??
              RetryOptions(maxAttempts: options.retryMaxAttempts))
          .retry(fn, retryIf: (e) => isDioError(e)));
}