Marc
03/21/2017, 11:58 AMval wait = BiFunction<Throwable, Int, Observable<Long>>(
{ throwable, iteration ->
if (throwable is RetryableException && iteration >= MAX_RETRIES) {
Observable.timer((iteration * WAITING_TIME_MULTIPLIER).toLong(), TimeUnit.SECONDS)
} else {
throw throwable //propagate the error
}
})