Join Slack
Powered by
fun IO<String>.retry(count: Int): IO<Stri...
# arrow
b
bjonnh
04/25/2019, 8:18 PM
fun IO<String>.retry(count: Int): IO<String> = handleErrorWith { withRetry(it, count) } fun IO<String>.withRetry(err: Throwable, retries: Int) = if (retries == 0) IO.raiseError(err) else handleErrorWith { withRetry(it, retries - 1) }
Open in Slack
Previous
Next