-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Closed
Description
I am working on a piece of code where I basically have a cached value, which I want to combine with other data and update from the network.
My thought was using combineLatestDelayError and magic would happen! Except when the network is down... Even though I have valid values in both my observables I only end up getting the error.
I narrowed it down to a simple test case:
@Test
public void combineLatestDelayErrorFailure() {
final int result = Observable.combineLatestDelayError(
Arrays.asList(
Observable.just(41).concatWith(Observable.error(new Exception("Failure"))),
Observable.just(1).delay(1, TimeUnit.SECONDS)
),
ints -> ((int) ints[0]) + ((int) ints[1])
).blockingFirst();
assertThat(result).isEqualTo(42);
}It always throws the Exception.
There is one point in the documentation about the calls being synchronous, though it is not clear to me how I could make changes to my observables to avoid that situation 😿
Reactions are currently unavailable