Last active
August 15, 2019 11:16
-
-
Save agustarc/5025a00379579fb3da3e19744c207848 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal typealias RETRY_PREDICATE = (Throwable) -> Boolean | |
internal const val MAX_RETRIES = 3L | |
internal const val DEFAULT_INTERVAL = 1L | |
internal val TIMEOUT: RETRY_PREDICATE = { it is SocketTimeoutException } | |
internal val NETWORK: RETRY_PREDICATE = { it is IOException } | |
internal val SERVICE_UNAVAILABLE: RETRY_PREDICATE = { it is HttpException && it.code() == 503 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment