Created
August 15, 2019 10:04
-
-
Save agustarc/e60e6f06cef6efaa8a3fdf079116e405 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
retryWhen { attempts -> | |
Flowables.zip( | |
attempts.map { error -> if (error is IOException) error else throw error }, | |
Flowable.interval(1, TimeUnit.SECONDS) | |
).map { (error, retryCount) -> if (retryCount >= 3) throw error } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment