Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static IResponse getResponse(IRequest newRequest) {
- return (IResponse) Observable.concat(
- Observable.just(newRequest)
- .map(r ->Try.of(()->cacheResource.getResponse(r)))
- .filter(Try::isSuccess)
- .map(Try::get),
- Observable.just(newRequest)
- .map(r ->Try.of(()->fileResource.getResponse(r)))
- .filter(Try::isSuccess)
- .map(Try::get)
- ).first(null);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement