Skip to content

Instantly share code, notes, and snippets.

@agustarc
Last active August 15, 2019 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agustarc/5025a00379579fb3da3e19744c207848 to your computer and use it in GitHub Desktop.
Save agustarc/5025a00379579fb3da3e19744c207848 to your computer and use it in GitHub Desktop.
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