Skip to content

Instantly share code, notes, and snippets.

@shamoh
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shamoh/64b62a1117e8de8b2743 to your computer and use it in GitHub Desktop.
Save shamoh/64b62a1117e8de8b2743 to your computer and use it in GitHub Desktop.
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