retryWhen

suspend fun <T> retryWhen(requestedState: Flow<RetryLoopFlowState>, scheduleBase: Duration = 100.milliseconds, scheduleFactor: Double = 2.0, scheduleLimit: Duration = 5.minutes, onError: suspend (error: Throwable) -> Unit = {}, onCancel: suspend () -> Unit = {}, block: suspend () -> T): T