retryWhenWithExponentialBackoff

fun <T> Flow<T>.retryWhenWithExponentialBackoff(initialDelay: Duration, factor: Double, maxDelay: Duration = Duration.INFINITE, predicate: suspend FlowCollector<T>.(cause: Throwable, attempt: Long) -> Boolean): Flow<T>(source)

Retries collection of the given flow with exponential backoff delay strategy when an exception occurs in the upstream flow and the predicate returns true. When predicate returns true, the next retries will be delayed after a duration computed by DelayStrategy.ExponentialBackoffDelayStrategy.

See retryWhenWithDelayStrategy and DelayStrategy.ExponentialBackoffDelayStrategy for more details.