public abstract class RxJavaSingleExecutionHook
extends java.lang.Object
Single
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 single so all behavior should be fast. If anything time-consuming is to be done it should be spawned asynchronously onto separate worker threads.
Constructor and Description |
---|
RxJavaSingleExecutionHook() |
Modifier and Type | Method and Description |
---|---|
<T> Single.OnSubscribe<T> |
onCreate(Single.OnSubscribe<T> f)
Deprecated.
|
<T,R> Observable.Operator<? extends R,? super T> |
onLift(Observable.Operator<? extends R,? super T> lift)
Deprecated.
|
<T> java.lang.Throwable |
onSubscribeError(java.lang.Throwable e)
Deprecated.
|
<T> Subscription |
onSubscribeReturn(Subscription subscription)
Deprecated.
|
<T> Observable.OnSubscribe<T> |
onSubscribeStart(Single<? extends T> singleInstance,
Observable.OnSubscribe<T> onSubscribe)
Deprecated.
|
@Deprecated public <T> Single.OnSubscribe<T> onCreate(Single.OnSubscribe<T> f)
Single.create(Single.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.
T
- the value type emitted by Singlef
- original Single.OnSubscribe
<T
> to be executedSingle.OnSubscribe
<T
> function that can be modified, decorated, replaced or just
returned as a pass through@Deprecated public <T> Observable.OnSubscribe<T> onSubscribeStart(Single<? extends T> singleInstance, Observable.OnSubscribe<T> onSubscribe)
Single.subscribe(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.
T
- the value type emittedsingleInstance
- the parent single instanceonSubscribe
- original Observable.OnSubscribe
<T
> to be executedObservable.OnSubscribe
<T
> function that can be modified, decorated, replaced or just
returned as a pass through@Deprecated public <T> Subscription onSubscribeReturn(Subscription subscription)
Single.subscribe(Subscriber)
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 through the subscription.
T
- the value type emitted by Singlesubscription
- original Subscription
Subscription
subscription that can be modified, decorated, replaced or just returned as a
pass through@Deprecated public <T> java.lang.Throwable onSubscribeError(java.lang.Throwable e)
Single.subscribe(Subscriber)
with thrown Throwable.
This is not errors emitted via Observer.onError(Throwable)
but exceptions thrown when
attempting to subscribe to a Func1
<Subscriber
<T>
, Subscription
>.
T
- the value type emitted by Singlee
- Throwable thrown by Single.subscribe(Subscriber)
@Deprecated public <T,R> Observable.Operator<? extends R,? super T> onLift(Observable.Operator<? extends R,? super T> lift)
Single
and the return value is used as the lifted function
This 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.
T
- the upstream value type (input)R
- the downstream value type (output)lift
- original Observable.Operator
<R, T>
Observable.Operator
<R, T>
function that can be modified, decorated, replaced or just
returned as a pass through