Class RxJavaHooks
The class features a lockdown state, see lockdown()
and isLockdown()
, to
prevent further changes to the hooks.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static boolean
Prevents changing the hook callbacks when set to true.(package private) static Func1
<Completable.CompletableOnSubscribe, Completable.CompletableOnSubscribe> (package private) static Func1
<Completable.CompletableOperator, Completable.CompletableOperator> (package private) static Func2
<Completable, Completable.CompletableOnSubscribe, Completable.CompletableOnSubscribe> (package private) static Func0
<? extends ScheduledExecutorService> (package private) static Func1
<Observable.OnSubscribe, Observable.OnSubscribe> (package private) static Func1
<Observable.Operator, Observable.Operator> (package private) static Func1
<Subscription, Subscription> (package private) static Func2
<Observable, Observable.OnSubscribe, Observable.OnSubscribe> (package private) static Func1
<Single.OnSubscribe, Single.OnSubscribe> (package private) static Func1
<Observable.Operator, Observable.Operator> (package private) static Func1
<Subscription, Subscription> (package private) static Func2
<Single, Observable.OnSubscribe, Observable.OnSubscribe> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
Clears all hooks to be no-operations (and passthroughs) and onError hook to signal errors to the caller thread's UncaughtExceptionHandler.static void
Clears the assembly tracking hooks to their default pass-through behavior.static void
Sets up hooks that capture the current stacktrace when a source or an operator is instantiated, keeping it in a field for debugging purposes and alters exceptions passign along to hold onto this stacktrace.Returns the current Completable onCreate hook function or null if it is set to the default pass-through.Returns the current Completable onLift hook function or null if it is set to the default pass-through.Returns the current Completable onStart hook function or null if it is set to the default pass-through.Returns the current Completable onSubscribeError hook function or null if it is set to the default pass-through.Returns the current computation scheduler hook function or null if it is set to the default pass-through.Returns the current global error handler hook action or null if it is set to the default one that signals errors to the current threads UncaughtExceptionHandler.static Func0
<? extends ScheduledExecutorService> Returns the current factory for creating ScheduledExecutorServices in GenericScheduledExecutorService utility.Returns the current io scheduler hook function or null if it is set to the default pass-through.Returns the current new thread scheduler hook function or null if it is set to the default pass-through.Returns the current Observable onCreate hook function or null if it is set to the default pass-through.Returns the current Observable onLift hook function or null if it is set to the default pass-through.static Func1
<Subscription, Subscription> Returns the current Observable onReturn hook function or null if it is set to the default pass-through.Returns the current Observable onStart hook function or null if it is set to the default pass-through.Returns the current Observable onSubscribeError hook function or null if it is set to the default pass-through.Returns the current schedule action hook function or null if it is set to the default pass-through.Returns the current Single onCreate hook function or null if it is set to the default pass-through.Returns the current Single onLift hook function or null if it is set to the default pass-through.static Func1
<Subscription, Subscription> Returns the current Single onReturn hook function or null if it is set to the default pass-through.Returns the current Single onStart hook function or null if it is set to the default pass-through.Returns the current Single onSubscribeError hook function or null if it is set to the default pass-through.(package private) static void
init()
Initialize the hooks via delegating to RxJavaPlugins.(package private) static void
static boolean
Returns true if the hooks can no longer be changed.static void
lockdown()
Prevents changing the hooks.static Throwable
onCompletableError
(Throwable error) Hook to call if the Completable.subscribe() crashes for some reason.static <T,
R> Completable.CompletableOperator Hook to call before the child subscriber would subscribe to an Operator.static <T> Completable.CompletableOnSubscribe
onCompletableStart
(Completable instance, Completable.CompletableOnSubscribe onSubscribe) Hook to call before the child subscriber is subscribed to the OnSubscribe action.static Scheduler
onComputationScheduler
(Scheduler scheduler) Hook to call when the Schedulers.computation() is called.onCreate
(Completable.CompletableOnSubscribe onSubscribe) Hook to call when a Completable is created.static <T> Observable.OnSubscribe
<T> onCreate
(Observable.OnSubscribe<T> onSubscribe) Hook to call when an Observable is created.static <T> Single.OnSubscribe
<T> onCreate
(Single.OnSubscribe<T> onSubscribe) Hook to call when a Single is created.static void
Consume undeliverable Throwables (acts as a global catch).static Scheduler
onIOScheduler
(Scheduler scheduler) Hook to call when the Schedulers.io() is called.static Scheduler
onNewThreadScheduler
(Scheduler scheduler) Hook to call when the Schedulers.newThread() is called.static Throwable
onObservableError
(Throwable error) Hook to call if the Observable.subscribe() crashes for some reason.static <T,
R> Observable.Operator <R, T> onObservableLift
(Observable.Operator<R, T> operator) Hook to call before the child subscriber would subscribe to an Operator.static Subscription
onObservableReturn
(Subscription subscription) Hook to call before the Observable.subscribe() method is about to return a Subscription.static <T> Observable.OnSubscribe
<T> onObservableStart
(Observable<T> instance, Observable.OnSubscribe<T> onSubscribe) Hook to call before the child subscriber is subscribed to the OnSubscribe action.static Action0
onScheduledAction
(Action0 action) Hook to call before the action is scheduled, allows decorating the original action.static Throwable
onSingleError
(Throwable error) Hook to call if the Single.subscribe() crashes for some reason.static <T,
R> Observable.Operator <R, T> onSingleLift
(Observable.Operator<R, T> operator) Hook to call before the child subscriber would subscribe to an Operator.static Subscription
onSingleReturn
(Subscription subscription) Hook to call before the Single.subscribe() method is about to return a Subscription.static <T> Observable.OnSubscribe
<T> onSingleStart
(Single<T> instance, Observable.OnSubscribe<T> onSubscribe) Hook to call before the child subscriber is subscribed to the OnSubscribe action.static void
reset()
Reset all hook callbacks to those of the current RxJavaPlugins handlers.static void
Resets the assembly tracking hooks to their default delegates to RxJavaPlugins.static void
setOnCompletableCreate
(Func1<Completable.CompletableOnSubscribe, Completable.CompletableOnSubscribe> onCompletableCreate) Sets the Completable's onCreate hook function unless a lockdown is in effect.static void
setOnCompletableLift
(Func1<Completable.CompletableOperator, Completable.CompletableOperator> onCompletableLift) Sets a hook function that is called with an operator when an Completable operator built with lift() gets subscribed to.static void
setOnCompletableStart
(Func2<Completable, Completable.CompletableOnSubscribe, Completable.CompletableOnSubscribe> onCompletableStart) Sets the hook function that is called when a subscriber subscribes to a Completable unless a lockdown is in effect.static void
setOnCompletableSubscribeError
(Func1<Throwable, Throwable> onCompletableSubscribeError) Sets a hook function that is called when the Completable.subscribe() call fails with an exception.static void
setOnComputationScheduler
(Func1<Scheduler, Scheduler> onComputationScheduler) Sets the hook function for returning a scheduler when the Schedulers.computation() is called unless a lockdown is in effect.static void
setOnError
(Action1<Throwable> onError) Sets the global error consumer action unless a lockdown is in effect.static void
setOnGenericScheduledExecutorService
(Func0<? extends ScheduledExecutorService> factory) Sets the hook function for returning a ScheduledExecutorService used by the GenericScheduledExecutorService for background tasks.static void
setOnIOScheduler
(Func1<Scheduler, Scheduler> onIOScheduler) Sets the hook function for returning a scheduler when the Schedulers.io() is called unless a lockdown is in effect.static void
setOnNewThreadScheduler
(Func1<Scheduler, Scheduler> onNewThreadScheduler) Sets the hook function for returning a scheduler when the Schedulers.newThread() is called unless a lockdown is in effect.static void
setOnObservableCreate
(Func1<Observable.OnSubscribe, Observable.OnSubscribe> onObservableCreate) Sets the Observable onCreate hook function unless a lockdown is in effect.static void
setOnObservableLift
(Func1<Observable.Operator, Observable.Operator> onObservableLift) Sets a hook function that is called with an operator when an Observable operator built with lift() gets subscribed to.static void
setOnObservableReturn
(Func1<Subscription, Subscription> onObservableReturn) Sets a hook function that is called when the Observable.subscribe() call is about to return a Subscription unless a lockdown is in effect.static void
setOnObservableStart
(Func2<Observable, Observable.OnSubscribe, Observable.OnSubscribe> onObservableStart) Sets the hook function that is called when a subscriber subscribes to a Observable unless a lockdown is in effect.static void
setOnObservableSubscribeError
(Func1<Throwable, Throwable> onObservableSubscribeError) Sets a hook function that is called when the Observable.subscribe() call fails with an exception.static void
setOnScheduleAction
(Func1<Action0, Action0> onScheduleAction) Sets the hook function that is called before an action is scheduled, allowing decorating that function, unless a lockdown is in effect.static void
setOnSingleCreate
(Func1<Single.OnSubscribe, Single.OnSubscribe> onSingleCreate) Sets the Single onCreate hook function unless a lockdown is in effect.static void
setOnSingleLift
(Func1<Observable.Operator, Observable.Operator> onSingleLift) Sets a hook function that is called with an operator when an Single operator built with lift() gets subscribed to.static void
setOnSingleReturn
(Func1<Subscription, Subscription> onSingleReturn) Sets a hook function that is called when the Single.subscribe() call is about to return a Subscription unless a lockdown is in effect.static void
setOnSingleStart
(Func2<Single, Observable.OnSubscribe, Observable.OnSubscribe> onSingleStart) Sets the hook function that is called when a subscriber subscribes to a Single unless a lockdown is in effect.static void
setOnSingleSubscribeError
(Func1<Throwable, Throwable> onSingleSubscribeError) Sets a hook function that is called when the Single.subscribe() call fails with an exception.(package private) static void
-
Field Details
-
lockdown
static volatile boolean lockdownPrevents changing the hook callbacks when set to true. -
onError
-
onObservableCreate
-
onSingleCreate
-
onCompletableCreate
static volatile Func1<Completable.CompletableOnSubscribe,Completable.CompletableOnSubscribe> onCompletableCreate -
onObservableStart
-
onSingleStart
-
onCompletableStart
static volatile Func2<Completable,Completable.CompletableOnSubscribe, onCompletableStartCompletable.CompletableOnSubscribe> -
onComputationScheduler
-
onIOScheduler
-
onNewThreadScheduler
-
onScheduleAction
-
onObservableReturn
-
onSingleReturn
-
onGenericScheduledExecutorService
-
onObservableSubscribeError
-
onSingleSubscribeError
-
onCompletableSubscribeError
-
onObservableLift
-
onSingleLift
-
onCompletableLift
static volatile Func1<Completable.CompletableOperator,Completable.CompletableOperator> onCompletableLift
-
-
Constructor Details
-
RxJavaHooks
private RxJavaHooks()Utility class.
-
-
Method Details
-
init
static void init()Initialize the hooks via delegating to RxJavaPlugins. -
initCreate
static void initCreate() -
reset
public static void reset()Reset all hook callbacks to those of the current RxJavaPlugins handlers.- See Also:
-
clear
public static void clear()Clears all hooks to be no-operations (and passthroughs) and onError hook to signal errors to the caller thread's UncaughtExceptionHandler.- See Also:
-
lockdown
public static void lockdown()Prevents changing the hooks. -
isLockdown
public static boolean isLockdown()Returns true if the hooks can no longer be changed.- Returns:
- true if the hooks can no longer be changed
-
onError
Consume undeliverable Throwables (acts as a global catch).- Parameters:
ex
- the exception to handle
-
signalUncaught
-
onCreate
Hook to call when an Observable is created.- Type Parameters:
T
- the value type- Parameters:
onSubscribe
- the original OnSubscribe logic- Returns:
- the original or replacement OnSubscribe instance
-
onCreate
Hook to call when a Single is created.- Type Parameters:
T
- the value type- Parameters:
onSubscribe
- the original OnSubscribe logic- Returns:
- the original or replacement OnSubscribe instance
-
onCreate
public static Completable.CompletableOnSubscribe onCreate(Completable.CompletableOnSubscribe onSubscribe) Hook to call when a Completable is created.- Parameters:
onSubscribe
- the original OnSubscribe logic- Returns:
- the original or replacement OnSubscribe instance
-
onComputationScheduler
Hook to call when the Schedulers.computation() is called.- Parameters:
scheduler
- the default computation scheduler- Returns:
- the default of alternative scheduler
-
onIOScheduler
Hook to call when the Schedulers.io() is called.- Parameters:
scheduler
- the default io scheduler- Returns:
- the default of alternative scheduler
-
onNewThreadScheduler
Hook to call when the Schedulers.newThread() is called.- Parameters:
scheduler
- the default new thread scheduler- Returns:
- the default of alternative scheduler
-
onScheduledAction
Hook to call before the action is scheduled, allows decorating the original action.- Parameters:
action
- the original action- Returns:
- the original or alternative action
-
onObservableStart
public static <T> Observable.OnSubscribe<T> onObservableStart(Observable<T> instance, Observable.OnSubscribe<T> onSubscribe) Hook to call before the child subscriber is subscribed to the OnSubscribe action.- Type Parameters:
T
- the value type- Parameters:
instance
- the parent Observable instanceonSubscribe
- the original OnSubscribe action- Returns:
- the original or alternative action that will be subscribed to
-
onObservableReturn
Hook to call before the Observable.subscribe() method is about to return a Subscription.- Parameters:
subscription
- the original subscription- Returns:
- the original or alternative subscription that will be returned
-
onObservableError
Hook to call if the Observable.subscribe() crashes for some reason.- Parameters:
error
- the error- Returns:
- the original error or alternative Throwable to be thrown
-
onObservableLift
Hook to call before the child subscriber would subscribe to an Operator.- Type Parameters:
T
- the input value typeR
- the output value type- Parameters:
operator
- the original operator- Returns:
- the original or alternative operator that will be subscribed to
-
onSingleStart
public static <T> Observable.OnSubscribe<T> onSingleStart(Single<T> instance, Observable.OnSubscribe<T> onSubscribe) Hook to call before the child subscriber is subscribed to the OnSubscribe action.- Type Parameters:
T
- the value type- Parameters:
instance
- the parent Single instanceonSubscribe
- the original OnSubscribe action- Returns:
- the original or alternative action that will be subscribed to
-
onSingleReturn
Hook to call before the Single.subscribe() method is about to return a Subscription.- Parameters:
subscription
- the original subscription- Returns:
- the original or alternative subscription that will be returned
-
onSingleError
Hook to call if the Single.subscribe() crashes for some reason.- Parameters:
error
- the error- Returns:
- the original error or alternative Throwable to be thrown
-
onSingleLift
Hook to call before the child subscriber would subscribe to an Operator.- Type Parameters:
T
- the input value typeR
- the output value type- Parameters:
operator
- the original operator- Returns:
- the original or alternative operator that will be subscribed to
-
onCompletableStart
public static <T> Completable.CompletableOnSubscribe onCompletableStart(Completable instance, Completable.CompletableOnSubscribe onSubscribe) Hook to call before the child subscriber is subscribed to the OnSubscribe action.- Type Parameters:
T
- the value type- Parameters:
instance
- the parent Completable instanceonSubscribe
- the original OnSubscribe action- Returns:
- the original or alternative action that will be subscribed to
-
onCompletableError
Hook to call if the Completable.subscribe() crashes for some reason.- Parameters:
error
- the error- Returns:
- the original error or alternative Throwable to be thrown
-
onCompletableLift
public static <T,R> Completable.CompletableOperator onCompletableLift(Completable.CompletableOperator operator) Hook to call before the child subscriber would subscribe to an Operator.- Type Parameters:
T
- the input value typeR
- the output value type- Parameters:
operator
- the original operator- Returns:
- the original or alternative operator that will be subscribed to
-
setOnError
Sets the global error consumer action unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: errors are routed to the current thread'sThread.UncaughtExceptionHandler
.- Parameters:
onError
- the action that will receive undeliverable Throwables
-
setOnCompletableCreate
public static void setOnCompletableCreate(Func1<Completable.CompletableOnSubscribe, Completable.CompletableOnSubscribe> onCompletableCreate) Sets the Completable's onCreate hook function unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onCompletableCreate
- the function that takes the original CompletableOnSubscribe and should return a CompletableOnSubscribe.
-
setOnObservableCreate
public static void setOnObservableCreate(Func1<Observable.OnSubscribe, Observable.OnSubscribe> onObservableCreate) Sets the Observable onCreate hook function unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onObservableCreate
- the function that takes the original OnSubscribe and should return a OnSubscribe.
-
setOnSingleCreate
Sets the Single onCreate hook function unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onSingleCreate
- the function that takes the original OnSubscribe and should return a OnSubscribe.
-
setOnComputationScheduler
Sets the hook function for returning a scheduler when the Schedulers.computation() is called unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onComputationScheduler
- the function that receives the original computation scheduler and should return a scheduler.
-
setOnIOScheduler
Sets the hook function for returning a scheduler when the Schedulers.io() is called unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onIOScheduler
- the function that receives the original io scheduler and should return a scheduler.
-
setOnNewThreadScheduler
Sets the hook function for returning a scheduler when the Schedulers.newThread() is called unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onNewThreadScheduler
- the function that receives the original new thread scheduler and should return a scheduler.
-
setOnScheduleAction
Sets the hook function that is called before an action is scheduled, allowing decorating that function, unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onScheduleAction
- the function that receives the original action and should return an Action0.
-
setOnCompletableStart
public static void setOnCompletableStart(Func2<Completable, Completable.CompletableOnSubscribe, Completable.CompletableOnSubscribe> onCompletableStart) Sets the hook function that is called when a subscriber subscribes to a Completable unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same CompletableOnSubscribe object.- Parameters:
onCompletableStart
- the function that is called with the current Completable instance, its CompletableOnSubscribe function and should return a CompletableOnSubscribe function that gets actually subscribed to.
-
setOnObservableStart
public static void setOnObservableStart(Func2<Observable, Observable.OnSubscribe, Observable.OnSubscribe> onObservableStart) Sets the hook function that is called when a subscriber subscribes to a Observable unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same OnSubscribe object.- Parameters:
onObservableStart
- the function that is called with the current Observable instance, its OnSubscribe function and should return a OnSubscribe function that gets actually subscribed to.
-
setOnSingleStart
public static void setOnSingleStart(Func2<Single, Observable.OnSubscribe, Observable.OnSubscribe> onSingleStart) Sets the hook function that is called when a subscriber subscribes to a Single unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same OnSubscribe object.- Parameters:
onSingleStart
- the function that is called with the current Single instance, its OnSubscribe function and should return a OnSubscribe function that gets actually subscribed to.
-
setOnObservableReturn
Sets a hook function that is called when the Observable.subscribe() call is about to return a Subscription unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onObservableReturn
- the function that is called with the Subscriber that has been subscribed to the OnSubscribe function and returns a Subscription that will be returned by subscribe().
-
setOnSingleReturn
Sets a hook function that is called when the Single.subscribe() call is about to return a Subscription unless a lockdown is in effect.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onSingleReturn
- the function that is called with the SingleSubscriber that has been subscribed to the OnSubscribe function and returns a Subscription that will be returned by subscribe().
-
setOnSingleSubscribeError
Sets a hook function that is called when the Single.subscribe() call fails with an exception.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onSingleSubscribeError
- the function that is called with the crash exception and should return an exception.
-
getOnSingleSubscribeError
Returns the current Single onSubscribeError hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
setOnCompletableSubscribeError
public static void setOnCompletableSubscribeError(Func1<Throwable, Throwable> onCompletableSubscribeError) Sets a hook function that is called when the Completable.subscribe() call fails with an exception.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onCompletableSubscribeError
- the function that is called with the crash exception and should return an exception.
-
getOnCompletableSubscribeError
Returns the current Completable onSubscribeError hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
setOnObservableSubscribeError
public static void setOnObservableSubscribeError(Func1<Throwable, Throwable> onObservableSubscribeError) Sets a hook function that is called when the Observable.subscribe() call fails with an exception.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onObservableSubscribeError
- the function that is called with the crash exception and should return an exception.
-
getOnObservableSubscribeError
Returns the current Observable onSubscribeError hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
setOnObservableLift
public static void setOnObservableLift(Func1<Observable.Operator, Observable.Operator> onObservableLift) Sets a hook function that is called with an operator when an Observable operator built with lift() gets subscribed to.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onObservableLift
- the function that is called with original Operator and should return an Operator instance.
-
getOnObservableLift
Returns the current Observable onLift hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
setOnSingleLift
Sets a hook function that is called with an operator when an Single operator built with lift() gets subscribed to.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onSingleLift
- the function that is called with original Operator and should return an Operator instance.
-
getOnSingleLift
Returns the current Single onLift hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
setOnCompletableLift
public static void setOnCompletableLift(Func1<Completable.CompletableOperator, Completable.CompletableOperator> onCompletableLift) Sets a hook function that is called with an operator when an Completable operator built with lift() gets subscribed to.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: the hook returns the same object.- Parameters:
onCompletableLift
- the function that is called with original Operator and should return an Operator instance.
-
getOnCompletableLift
public static Func1<Completable.CompletableOperator,Completable.CompletableOperator> getOnCompletableLift()Returns the current Completable onLift hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
getOnComputationScheduler
Returns the current computation scheduler hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
getOnError
Returns the current global error handler hook action or null if it is set to the default one that signals errors to the current threads UncaughtExceptionHandler.This operation is threadsafe.
- Returns:
- the current hook action
-
getOnIOScheduler
Returns the current io scheduler hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
getOnNewThreadScheduler
Returns the current new thread scheduler hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
getOnObservableCreate
Returns the current Observable onCreate hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
getOnScheduleAction
Returns the current schedule action hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
getOnSingleCreate
Returns the current Single onCreate hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
getOnCompletableCreate
public static Func1<Completable.CompletableOnSubscribe,Completable.CompletableOnSubscribe> getOnCompletableCreate()Returns the current Completable onCreate hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
getOnCompletableStart
public static Func2<Completable,Completable.CompletableOnSubscribe, getOnCompletableStart()Completable.CompletableOnSubscribe> Returns the current Completable onStart hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
getOnObservableStart
public static Func2<Observable,Observable.OnSubscribe, getOnObservableStart()Observable.OnSubscribe> Returns the current Observable onStart hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
getOnSingleStart
Returns the current Single onStart hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
getOnObservableReturn
Returns the current Observable onReturn hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
getOnSingleReturn
Returns the current Single onReturn hook function or null if it is set to the default pass-through.This operation is threadsafe.
- Returns:
- the current hook function
-
resetAssemblyTracking
public static void resetAssemblyTracking()Resets the assembly tracking hooks to their default delegates to RxJavaPlugins. -
clearAssemblyTracking
public static void clearAssemblyTracking()Clears the assembly tracking hooks to their default pass-through behavior. -
enableAssemblyTracking
public static void enableAssemblyTracking()Sets up hooks that capture the current stacktrace when a source or an operator is instantiated, keeping it in a field for debugging purposes and alters exceptions passign along to hold onto this stacktrace. -
setOnGenericScheduledExecutorService
public static void setOnGenericScheduledExecutorService(Func0<? extends ScheduledExecutorService> factory) Sets the hook function for returning a ScheduledExecutorService used by the GenericScheduledExecutorService for background tasks.This operation is threadsafe.
Calling with a
null
parameter restores the default behavior: create the default withExecutors.newScheduledThreadPool(int, java.util.concurrent.ThreadFactory)
.For the changes to take effect, the Schedulers has to be restarted.
- Parameters:
factory
- the supplier that is called when the GenericScheduledExecutorService is (re)started
-
getOnGenericScheduledExecutorService
Returns the current factory for creating ScheduledExecutorServices in GenericScheduledExecutorService utility.This operation is threadsafe.
- Returns:
- the current factory function
-