@Experimental public abstract class RxJavaCompletableExecutionHook extends java.lang.Object
Completable
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 completable 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 |
---|
RxJavaCompletableExecutionHook() |
Modifier and Type | Method and Description |
---|---|
Completable.CompletableOnSubscribe |
onCreate(Completable.CompletableOnSubscribe f)
Invoked during the construction by
Completable.create(Completable.CompletableOnSubscribe) |
Completable.CompletableOperator |
onLift(Completable.CompletableOperator lift)
Invoked just as the operator functions is called to bind two operations together into a new
Completable and the return value is used as the lifted function |
java.lang.Throwable |
onSubscribeError(java.lang.Throwable e)
Invoked after failed execution of
Completable.subscribe(Subscriber) with thrown Throwable. |
Completable.CompletableOnSubscribe |
onSubscribeStart(Completable completableInstance,
Completable.CompletableOnSubscribe onSubscribe)
Invoked before
Completable.subscribe(Subscriber) is about to be executed. |
public Completable.CompletableOnSubscribe onCreate(Completable.CompletableOnSubscribe f)
Completable.create(Completable.CompletableOnSubscribe)
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.
f
- original Completable.CompletableOnSubscribe
<T
> to be executedCompletable.CompletableOnSubscribe
function that can be modified, decorated, replaced or just
returned as a pass throughpublic Completable.CompletableOnSubscribe onSubscribeStart(Completable completableInstance, Completable.CompletableOnSubscribe onSubscribe)
Completable.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.
completableInstance
- the target completable instanceonSubscribe
- original Completable.CompletableOnSubscribe
<T
> to be executedCompletable.CompletableOnSubscribe
<T
> function that can be modified, decorated, replaced or just
returned as a pass throughpublic java.lang.Throwable onSubscribeError(java.lang.Throwable e)
Completable.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
>.
e
- Throwable thrown by Completable.subscribe(Subscriber)
public Completable.CompletableOperator onLift(Completable.CompletableOperator lift)
Completable
and the return value is used as the lifted function
This can be used to decorate or replace the Completable.CompletableOperator
instance or just perform extra
logging, metrics and other such things and pass through the onSubscribe.
lift
- original Completable.CompletableOperator
<R, T>
Completable.CompletableOperator
<R, T>
function that can be modified, decorated, replaced or just
returned as a pass through