Top Description Constructors Methods
rx.plugins

public abstract Class RxJavaObservableExecutionHook

extends Object
Class Inheritance
Known Direct Subclasses
rx.plugins.RxJavaObservableExecutionHookDefault
Imports
rx.Observable, .Observable.OnSubscribe, .Observable.Operator, .Subscriber, .Subscription, rx.functions.Func1

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/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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <
the value type
T
>
Observable.OnSubscribe<T>

Returns:

OnSubscribe<T> function that can be modified, decorated, replaced or just returned as a pass through
onCreate
(Observable.OnSubscribe<T>
original OnSubscribe<T> to be executed
f
)

Deprecated
Invoked during the construction by Observable#unsafeCreate(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.

public <
the upstream's value type (input)
T
,
the downstream's value type (output)
R
>
Observable.Operator<? extends R, ? super T>

Returns:

Operator<R, T> function that can be modified, decorated, replaced or just returned as a pass through
onLift
(final Observable.Operator<? extends R, ? super T>
original Operator<R, T>
lift
)

Deprecated
Invoked just as the operator functions is called to bind two operations together into a new Observable and the return value is used as the lifted function

This can be used to decorate or replace the Operator instance or just perform extra logging, metrics and other such things and pass through the onSubscribe.

public <
the value type
T
>
Throwable

Returns:

Throwable that can be decorated, replaced or just returned as a pass through
onSubscribeError
(Throwable e)

Deprecated
Invoked after failed execution of Observable#subscribe(Subscriber) with thrown Throwable.
public <
the value type
T
>
Subscription

Returns:

Subscription subscription that can be modified, decorated, replaced or just returned as a pass through
onSubscribeReturn
(Subscription
original Subscription
subscription
)

Deprecated
Invoked after successful execution of Observable#subscribe(rx.Subscriber) with returned Subscription.
public <
the value type
T
>
Observable.OnSubscribe<T>

Returns:

OnSubscribe<T> function that can be modified, decorated, replaced or just returned as a pass through
onSubscribeStart
(Observable<? extends T>
the parent observable instance
observableInstance
,
final Observable.OnSubscribe<T>
original OnSubscribe<T> to be executed
onSubscribe
)

Deprecated
Invoked before Observable#subscribe(rx.Subscriber) is about to be executed.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RxJavaObservableExecutionHookback to summary
public RxJavaObservableExecutionHook()

Method Detail

onCreateback to summary
public <T> Observable.OnSubscribe<T> onCreate(Observable.OnSubscribe<T> f)

Deprecated

Invoked during the construction by Observable#unsafeCreate(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.

Parameters
<T>
the value type
f:Observable.OnSubscribe<T>

original OnSubscribe<T> to be executed

Returns:Observable.OnSubscribe<T>

OnSubscribe<T> function that can be modified, decorated, replaced or just returned as a pass through

Annotations
@Deprecated
onLiftback to summary
public <T, R> Observable.Operator<? extends R, ? super T> onLift(final Observable.Operator<? extends R, ? super T> lift)

Deprecated

Invoked just as the operator functions is called to bind two operations together into a new Observable and the return value is used as the lifted function

This can be used to decorate or replace the Operator instance or just perform extra logging, metrics and other such things and pass through the onSubscribe.

Parameters
<T>
the upstream's value type (input)
<R>
the downstream's value type (output)
lift:Observable.Operator<? extends R, ? super T>

original Operator<R, T>

Returns:Observable.Operator<? extends R, ? super T>

Operator<R, T> function that can be modified, decorated, replaced or just returned as a pass through

Annotations
@Deprecated
onSubscribeErrorback to summary
public <T> Throwable onSubscribeError(Throwable e)

Deprecated

Invoked after failed execution of Observable#subscribe(Subscriber) with thrown Throwable.

This is not errors emitted via Subscriber#onError(Throwable) but exceptions thrown when attempting to subscribe to a Func1<Subscriber<T>, Subscription>.

Parameters
<T>
the value type
e:Throwable

Throwable thrown by Observable#subscribe(Subscriber)

Returns:Throwable

Throwable that can be decorated, replaced or just returned as a pass through

Annotations
@Deprecated
onSubscribeReturnback to summary
public <T> Subscription onSubscribeReturn(Subscription subscription)

Deprecated

Invoked after successful execution of Observable#subscribe(rx.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.

Parameters
<T>
the value type
subscription:Subscription

original Subscription

Returns:Subscription

Subscription subscription that can be modified, decorated, replaced or just returned as a pass through

Annotations
@Deprecated
onSubscribeStartback to summary
public <T> Observable.OnSubscribe<T> onSubscribeStart(Observable<? extends T> observableInstance, final Observable.OnSubscribe<T> onSubscribe)

Deprecated

Invoked before Observable#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.

Parameters
<T>
the value type
observableInstance:Observable<? extends T>

the parent observable instance

onSubscribe:Observable.OnSubscribe<T>

original OnSubscribe<T> to be executed

Returns:Observable.OnSubscribe<T>

OnSubscribe<T> function that can be modified, decorated, replaced or just returned as a pass through

Annotations
@Deprecated