Last active
August 15, 2019 11:35
-
-
Save agustarc/07a0a28d57a8a1baf9fe5cd724124fd9 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
single.retryWhen { attempts -> | |
Flowables.zip( | |
attempts.map { error -> if (predicates.count { it(error) } > 0) error else throw error }, | |
Flowable.interval(interval, unit) | |
).map { (error, retryCount) -> if (retryCount >= maxRetries) throw error } | |
} | |
single.onErrorResumeNext(resumeNext) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment