kirillrakhman
03/21/2017, 12:02 PMobject Wait : BiFunction<Throwable, Int, Observable<Long>> {
override fun ...(throwable: Throwable, iteration: Int ): Observable<Long> {
return if (throwable is RetryableException && iteration >= MAX_RETRIES) {
Observable.timer((iteration * WAITING_TIME_MULTIPLIER).toLong(), TimeUnit.SECONDS)
} else {
throw throwable //propagate the error
}
}
}