retryWhenWithDelayStrategy

fun <T> Flow<T>.retryWhenWithDelayStrategy(strategy: DelayStrategy, predicate: suspend FlowCollector<T>.(cause: Throwable, attempt: Long) -> Boolean): Flow<T>(source)

Retries collection of the given flow when an exception occurs in the upstream flow and the predicate returns true. The predicate also receives an attempt number as parameter, starting from zero on the initial call. When predicate returns true, the next retries will be delayed after a duration computed by DelayStrategy.nextDelay.

This operator is transparent to exceptions that occur in downstream flow and does not retry on exceptions that are thrown to cancel the flow.

See retryWhen for more details.