Skip to content

Instantly share code, notes, and snippets.

Working from home

Ahmed Rizwan ahmedrizwan

Working from home
Block or report user

Report or block ahmedrizwan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Retry.kt
Observable.fromPublisher<String> {
it.onNext("Doing a network call!")
Thread.sleep(1000) // Long running process
it.onError(Exception()) // Some error thrown
}.retryWhen { errors ->
errors.zipWith(Observable.range(1, 3) // Zip error observable with a range one
.concatMap { retryCount ->
Observable.timer(retryCount.toLong() * 10, TimeUnit.SECONDS)
You can’t perform that action at this time.