R - public interface HystrixObservable<R> extends HystrixInvokable<R>
observe() and toObservable() so client code can treat them the same and combine in typed collections if desired.| Modifier and Type | Method and Description |
|---|---|
rx.Observable<R> |
observe()
Used for asynchronous execution of command with a callback by subscribing to the
Observable. |
rx.Observable<R> |
toObservable()
Used for asynchronous execution of command with a callback by subscribing to the
Observable. |
rx.Observable<R> observe()
Observable.
This eagerly starts execution of the command the same as HystrixCommand.queue() and HystrixCommand.execute().
A lazy Observable can be obtained from toObservable().
Callback Scheduling
HystrixCommandProperties.ExecutionIsolationStrategy.THREAD this defaults to using Schedulers.computation() for callbacks.HystrixCommandProperties.ExecutionIsolationStrategy.SEMAPHORE this defaults to using Schedulers.immediate() for callbacks.See https://github.com/ReactiveX/RxJava/wiki for more information.
Observable<R> that executes and calls back with the result of the command execution or a fallback if the command execution fails for any reason.HystrixRuntimeException - if a fallback does not exist
Observer#onError if a failure occursHystrixBadRequestException - via Observer#onError if invalid arguments or state were used representing a user failure, not a system failurejava.lang.IllegalStateException - if invoked more than oncerx.Observable<R> toObservable()
Observable.
This lazily starts execution of the command only once the Observable is subscribed to.
An eager Observable can be obtained from observe()
Callback Scheduling
HystrixCommandProperties.ExecutionIsolationStrategy.THREAD this defaults to using Schedulers.computation() for callbacks.HystrixCommandProperties.ExecutionIsolationStrategy.SEMAPHORE this defaults to using Schedulers.immediate() for callbacks.See https://github.com/ReactiveX/RxJava/wiki for more information.
Observable<R> that executes and calls back with the result of the command execution or a fallback if the command execution fails for any reason.HystrixRuntimeException - if a fallback does not exist
Observer#onError if a failure occursHystrixBadRequestException - via Observer#onError if invalid arguments or state were used representing a user failure, not a system failurejava.lang.IllegalStateException - if invoked more than once