Title
k

kingsley

03/14/2017, 1:43 PM
This should work:
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

robin

03/14/2017, 1:43 PM
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

rudolf.hladik

03/14/2017, 1:45 PM
.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

kingsley

03/14/2017, 1:45 PM
Haha. Yea. Good catch @robin. I didn't attempt to see it compile 🙈
😄 1