Alexjok
07/17/2019, 12:17 PMkarelpeeters
07/17/2019, 12:20 PMAlexjok
07/17/2019, 12:27 PMsuspend fun <T> retry(times: Int = Int.MAX_VALUE, delayTime: Long = 1000L, block: suspend () -> T): T {
repeat(times) {
try {
return block()
} catch (e: Throwable) {
println(e.message)
}
delay(delayTime)
}
return block()
}
but i dont sure is there anything similar in the standard library