Top Description Constructors Methods
rx.plugins

public abstract Class RxJavaSingleExecutionHook

extends Object
Class Inheritance
Known Direct Subclasses
rx.plugins.RxJavaSingleExecutionHookDefault
Imports
rx.Observable, .Single, .Subscriber, .Subscription, rx.functions.Func1

Abstract ExecutionHook with invocations at different lifecycle points of 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 Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <
the value type emitted by Single
T
>
Single.OnSubscribe<T>

Returns:

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

Deprecated
Invoked during the construction by 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.

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

Returns:

rx.Observable.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 rx.Observable.Operator<R, T>
lift
)

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

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

public <
the value type emitted by Single
T
>
Throwable

Returns:

Throwable that can be decorated, replaced or just returned as a pass through
onSubscribeError
(Throwable
Throwable thrown by Single#subscribe(Subscriber)
e
)

Deprecated
Invoked after failed execution of Single#subscribe(Subscriber) with thrown Throwable.
public <
the value type emitted by Single
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 Single#subscribe(Subscriber) with returned Subscription.
public <
the value type emitted
T
>
Observable.OnSubscribe<T>

Returns:

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

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

Constructor Detail

RxJavaSingleExecutionHookback to summary
public RxJavaSingleExecutionHook()

Method Detail

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

Deprecated

Invoked during the construction by 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.

Parameters
<T>
the value type emitted by Single
f:Single.OnSubscribe<T>

original rx.Single.OnSubscribe<T> to be executed

Returns:Single.OnSubscribe<T>

rx.Single.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 Single and the return value is used as the lifted function

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

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

original rx.Observable.Operator<R, T>

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

rx.Observable.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 Single#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 emitted by Single
e:Throwable

Throwable thrown by Single#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 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.

Parameters
<T>
the value type emitted by Single
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(Single<? extends T> singleInstance, final Observable.OnSubscribe<T> onSubscribe)

Deprecated

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

Parameters
<T>
the value type emitted
singleInstance:Single<? extends T>

the parent single instance

onSubscribe:Observable.OnSubscribe<T>

original rx.Observable.OnSubscribe<T> to be executed

Returns:Observable.OnSubscribe<T>

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

Annotations
@Deprecated