This should work: ``` source.retryWhen { errors -&...
# getting-started
k
This should work:
Copy code
source.retryWhen { errors ->  
  errors
    .zipWith(Observable.range(1, 3)) { n, i -> i }
    .flatMap { retryCount -> Observable.timer(Math.pow(5.0, retryCount.toDouble()).toLong(), TimeUnit.SECONDS) }
}
I suppose you're on RxJava1?
👍 1
r
Now you beat me to it xD
😄 1
Although you're now missing the
Observable.timer
part, am I missing something or did you just oversee that?
r
.retryWhen { it -> it.zipWith(Observable.range(1,3), { n, i -> i }) .flatMap { retryCount -> Observable.timer( Math.pow(5.toDouble(), retryCount.toDouble()).toLong(), TimeUnit.SECONDS) } }
yeah now its working
thanks a lot
👍 1
k
Haha. Yea. Good catch @robin. I didn't attempt to see it compile 🙈
😄 1