|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrx.plugins.RxJavaObservableExecutionHook
public abstract class RxJavaObservableExecutionHook
Abstract ExecutionHook with invocations at different lifecycle points of Observable execution with a default no-op implementation.
See RxJavaPlugins or the RxJava GitHub Wiki for information on configuring plugins: https://github.com/Netflix/RxJava/wiki/Plugins.
Note on thread-safety and performance
A single implementation of this class will be used globally so methods on this class will be invoked concurrently from multiple threads so all functionality must be thread-safe.
Methods are also invoked synchronously and will add to execution time of the observable so all behavior should be fast. If anything time-consuming is to be done it should be spawned asynchronously onto separate worker threads.
| Constructor Summary | |
|---|---|
RxJavaObservableExecutionHook()
|
|
| Method Summary | ||
|---|---|---|
|
onSubscribeError(Observable<T> observableInstance,
java.lang.Exception e)
Invoked after failed execution of Observable.subscribe(Observer) with thrown Exception. |
|
|
onSubscribeReturn(Observable<T> observableInstance,
Subscription subscription)
Invoked after successful execution of Observable.subscribe(rx.Observer) with returned Subscription. |
|
|
onSubscribeStart(Observable<T> observableInstance,
Func1<Observer<T>,Subscription> onSubscribe)
Invoked before Observable.subscribe(rx.Observer) is about to be executed. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RxJavaObservableExecutionHook()
| Method Detail |
|---|
public <T> Func1<Observer<T>,Subscription> onSubscribeStart(Observable<T> observableInstance,
Func1<Observer<T>,Subscription> onSubscribe)
Observable.subscribe(rx.Observer) is about to be executed.
This can be used to decorate or replace the onSubscribe function or just perform extra logging, metrics and other such things and pass-thru the function.
observableInstance - The executing Observable instance.onSubscribe - original Func1<Observer, Subscription> to be executed
Func1<Observer, Subscription> function that can be modified, decorated, replaced or just returned as a pass-thru.
public <T> Subscription onSubscribeReturn(Observable<T> observableInstance,
Subscription subscription)
Observable.subscribe(rx.Observer) with returned Subscription.
This can be used to decorate or replace the Subscription instance or just perform extra logging, metrics and other such things and pass-thru the subscription.
observableInstance - The executing Observable instance.subscription - original Subscription
Subscription subscription that can be modified, decorated, replaced or just returned as a pass-thru.
public <T> java.lang.Exception onSubscribeError(Observable<T> observableInstance,
java.lang.Exception e)
Observable.subscribe(Observer) with thrown Exception.
This is NOT errors emitted via Observer.onError(Exception) but exceptions thrown when attempting
to subscribe to a Func1<Observer, Subscription>.
observableInstance - The executing Observable instance.e - Exception thrown by Observable.subscribe(Observer)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||