retry

abstract suspend fun <R> retry(policy: RetryPolicy<R>, block: suspend () -> R): Outcome<R>

Retry the given block of code until it's successful. Note this method throws exceptions for non-successful outcomes from retrying.

Return

The successful Outcome of the final retry attempt.

Parameters

policy

A RetryPolicy that can be used to evaluate the outcome of each retry attempt.

block

The block of code to retry.