Class RxJavaObservableExecutionHook
- Direct Known Subclasses:
RxJavaObservableExecutionHookDefault
Observable
execution with a
default no-op implementation.
See RxJavaPlugins
or the RxJava GitHub Wiki for information on configuring plugins:
https://github.com/ReactiveX/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
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Observable.OnSubscribe
<T> Deprecated.<T,
R> Observable.Operator <? extends R, ? super T> onLift
(Observable.Operator<? extends R, ? super T> lift) Deprecated.<T> Throwable
Deprecated.<T> Subscription
onSubscribeReturn
(Subscription subscription) Deprecated.<T> Observable.OnSubscribe
<T> onSubscribeStart
(Observable<? extends T> observableInstance, Observable.OnSubscribe<T> onSubscribe) Deprecated.
-
Constructor Details
-
RxJavaObservableExecutionHook
public RxJavaObservableExecutionHook()
-
-
Method Details
-
onCreate
Deprecated.Invoked during the construction byObservable.create(OnSubscribe)
This can be used to decorate or replace the
onSubscribe
function or just perform extra logging, metrics and other such things and pass through the function.- Type Parameters:
T
- the value type- Parameters:
f
- originalObservable.OnSubscribe
invalid input: '<'T
> to be executed- Returns:
Observable.OnSubscribe
invalid input: '<'T
> function that can be modified, decorated, replaced or just returned as a pass through
-
onSubscribeStart
@Deprecated public <T> Observable.OnSubscribe<T> onSubscribeStart(Observable<? extends T> observableInstance, Observable.OnSubscribe<T> onSubscribe) Deprecated.Invoked beforeObservable.subscribe(rx.Subscriber)
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 through the function.- Type Parameters:
T
- the value type- Parameters:
observableInstance
- the parent observable instanceonSubscribe
- originalObservable.OnSubscribe
invalid input: '<'T
> to be executed- Returns:
Observable.OnSubscribe
invalid input: '<'T
> function that can be modified, decorated, replaced or just returned as a pass through
-
onSubscribeReturn
Deprecated.Invoked after successful execution ofObservable.subscribe(rx.Subscriber)
with returnedSubscription
.This can be used to decorate or replace the
Subscription
instance or just perform extra logging, metrics and other such things and pass through the subscription.- Type Parameters:
T
- the value type- Parameters:
subscription
- originalSubscription
- Returns:
Subscription
subscription that can be modified, decorated, replaced or just returned as a pass through
-
onSubscribeError
Deprecated.Invoked after failed execution ofObservable.subscribe(Subscriber)
with thrown Throwable.This is not errors emitted via
Observer.onError(Throwable)
but exceptions thrown when attempting to subscribe to aFunc1
invalid input: '<'Subscriber
<T>
,Subscription
>.- Type Parameters:
T
- the value type- Parameters:
e
- Throwable thrown byObservable.subscribe(Subscriber)
- Returns:
- Throwable that can be decorated, replaced or just returned as a pass through
-
onLift
@Deprecated public <T,R> Observable.Operator<? extends R,? super T> onLift(Observable.Operator<? extends R, ? super T> lift) Deprecated.Invoked just as the operator functions is called to bind two operations together into a newObservable
and the return value is used as the lifted functionThis can be used to decorate or replace the
Observable.Operator
instance or just perform extra logging, metrics and other such things and pass through the onSubscribe.- Type Parameters:
T
- the upstream's value type (input)R
- the downstream's value type (output)- Parameters:
lift
- originalObservable.Operator
<R, T>
- Returns:
Observable.Operator
<R, T>
function that can be modified, decorated, replaced or just returned as a pass through
-