Created
November 24, 2016 20:11
-
-
Save murki/ff7afec07cd709cfa470f7a76cfda00c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DomainService.java | |
@RxLogObservable | |
public Observable<Data> getMergedData() { | |
return Observable.mergeDelayError( // <-- don't interrupt stream | |
diskRepository.getData().subscribeOn(Schedulers.io()), | |
networkRepository.getData() | |
.doOnNext(new Action1<Data>() { | |
@Override | |
public void call(Data data) { | |
diskRepository.saveData(data); | |
} | |
}).subscribeOn(Schedulers.io()) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment