Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial Success Fallback - HystrixObservableCommand #317

Closed
benjchristensen opened this issue Sep 24, 2014 · 3 comments
Closed

Partial Success Fallback - HystrixObservableCommand #317

benjchristensen opened this issue Sep 24, 2014 · 3 comments
Milestone

Comments

@benjchristensen
Copy link
Contributor

A HystrixObservableCommand can stream multiple values. This makes fallback a little more nuanced.

If it fails immediately, then nothing has been emitted via onNext and the getFallback() is easy to reason about.

If some values are emitted via onNext() but then it fails with onError (for any reason, including timeout) then it is partially successful.

The fallback() will then be applied with Observable.onErrorResumeNext which means the partially successful onNext already emitted are still there, then the fallback applies.

The question is ... what does this mean for a user? for the developer of the fallback?

It is far more nuanced than a scalar response (using HystrixCommand or HystrixAsyncCommand).

I think we should at least rename getFallback to resumeWithFallback or something that communicates it's not an either-or, but additive (by resuming).

An implementation of a command should maintain state internally if needed so the fallback can know about partial success. I don't want to make that part of the HystrixObservableCommand itself though, as some will possibly want to cache the results to know what has been sent, but that's expensive to do all the time when not needed.

I'd appreciate further thoughts on how this should behave and be implemented.

@benjchristensen benjchristensen added this to the 1.4 milestone Sep 24, 2014
@benjchristensen
Copy link
Contributor Author

/cc @KoltonAndrus @mattrjacobs

@benjchristensen
Copy link
Contributor Author

Possible signature:

protected Observable<R> onFailureResumeWithFallback()

@mattrjacobs mattrjacobs removed this from the 1.4 milestone Dec 19, 2014
@benjchristensen benjchristensen removed this from the 1.4 milestone Dec 19, 2014
@mattrjacobs mattrjacobs added this to the 1.4.0-RC7 milestone Dec 19, 2014
@mattrjacobs
Copy link
Contributor

This has already been implemented and unit-tested as resumeWithFallback()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants