retryIfSafe
Retries block up to times more times after a DispatchException whose DispatchException.safeToRetry says the exact same request can be sent again.
Source and package
- public Kotlin suspending functions Allows a function to call suspending operations and pause without blocking a thread. It does not start a coroutine by itself. Language documentation fun <T> retry
If (times: Int = 1, block: Kotlin suspending functions Allows a function to call suspending operations and pause without blocking a thread. It does not start a coroutine by itself. Language documentation () -> T): TSafe -
Description#
No retry executor lives in this library:
DispatchException.safeToRetryis computed by the operation that threw it from its own catalogued idempotence, so this needs no per-call lookup and composes with any retry library a caller already uses instead of replacing it.- Parameters
-
-
times ( Int )
-
block ( Kotlin suspending functions Allows a function to call suspending operations and pause without blocking a thread. It does not start a coroutine by itself. Language documentation )
-
Discussed in Getting started