Last active
August 29, 2015 14:13
-
-
Save shamoh/64b62a1117e8de8b2743 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
private class ForecastCommand extends HystrixObservableCommand<Forecast> { | |
private final Destination destination; | |
... | |
@Override | |
protected Observable<Forecast> run() { | |
return RxObservable.from(forecastWebTarget) | |
.resolveTemplate("destination", destination.getDestination()) | |
.request().rx() | |
.get(Forecast.class); | |
} | |
@Override | |
protected Observable<Forecast> getFallback() { | |
return Observable.just(new Forecast(destination.getDestination(), "N/A")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment