You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 thegetFallback()
is easy to reason about.If some values are emitted via
onNext()
but then it fails withonError
(for any reason, including timeout) then it is partially successful.The
fallback()
will then be applied withObservable.onErrorResumeNext
which means the partially successfulonNext
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
orHystrixAsyncCommand
).I think we should at least rename
getFallback
toresumeWithFallback
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.
The text was updated successfully, but these errors were encountered: