retry

inline suspend fun <T> retry(times: Int = 5, initialDelay: <Error class: unknown class> = 100.milliseconds, maxDelay: <Error class: unknown class> = 1.seconds, factor: Double = 2.0, block: () -> T): T

A utility function that retries a given block if it encounters an IOException.

Parameters

times

a number of attempts to perform the given block

initialDelay

a start delay between subsequent attempts

maxDelay

a maximum delay between subsequent attempts

factor

a speed at which the delay between subsequent attempts grows

block

a block to perform