java.lang.Object | |
↳ | io.reactivex.plugins.RxJavaPlugins |
Utility class to inject handlers to certain standard RxJava operations.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static Scheduler |
createComputationScheduler(ThreadFactory threadFactory)
Create an instance of the default
Scheduler used for computation()
except using threadFactory for thread creation. | ||||||||||
static Scheduler | createIoScheduler(ThreadFactory threadFactory) | ||||||||||
static Scheduler |
createNewThreadScheduler(ThreadFactory threadFactory)
Create an instance of the default
Scheduler used for newThread()
except using threadFactory for thread creation. | ||||||||||
static Scheduler | createSingleScheduler(ThreadFactory threadFactory) | ||||||||||
static Function<? super Scheduler, ? extends Scheduler> |
getComputationSchedulerHandler()
Returns the current hook function.
| ||||||||||
static Consumer<? super Throwable> |
getErrorHandler()
Returns the a hook consumer.
| ||||||||||
static Function<? super Callable<Scheduler>, ? extends Scheduler> |
getInitComputationSchedulerHandler()
Returns the current hook function.
| ||||||||||
static Function<? super Callable<Scheduler>, ? extends Scheduler> |
getInitIoSchedulerHandler()
Returns the current hook function.
| ||||||||||
static Function<? super Callable<Scheduler>, ? extends Scheduler> |
getInitNewThreadSchedulerHandler()
Returns the current hook function.
| ||||||||||
static Function<? super Callable<Scheduler>, ? extends Scheduler> |
getInitSingleSchedulerHandler()
Returns the current hook function.
| ||||||||||
static Function<? super Scheduler, ? extends Scheduler> |
getIoSchedulerHandler()
Returns the current hook function.
| ||||||||||
static Function<? super Scheduler, ? extends Scheduler> |
getNewThreadSchedulerHandler()
Returns the current hook function.
| ||||||||||
static BooleanSupplier |
getOnBeforeBlocking()
Returns the current blocking handler or null if no custom handler
is set.
| ||||||||||
static Function<? super Completable, ? extends Completable> |
getOnCompletableAssembly()
Returns the current hook function.
| ||||||||||
static BiFunction<? super Completable, ? super CompletableObserver, ? extends CompletableObserver> |
getOnCompletableSubscribe()
Returns the current hook function.
| ||||||||||
static Function<? super ConnectableFlowable, ? extends ConnectableFlowable> |
getOnConnectableFlowableAssembly()
Returns the current hook function.
| ||||||||||
static Function<? super ConnectableObservable, ? extends ConnectableObservable> |
getOnConnectableObservableAssembly()
Returns the current hook function.
| ||||||||||
static Function<? super Flowable, ? extends Flowable> |
getOnFlowableAssembly()
Returns the current hook function.
| ||||||||||
static BiFunction<? super Flowable, ? super Subscriber, ? extends Subscriber> |
getOnFlowableSubscribe()
Returns the current hook function.
| ||||||||||
static Function<? super Maybe, ? extends Maybe> |
getOnMaybeAssembly()
Returns the current hook function.
| ||||||||||
static BiFunction<? super Maybe, ? super MaybeObserver, ? extends MaybeObserver> |
getOnMaybeSubscribe()
Returns the current hook function.
| ||||||||||
static Function<? super Observable, ? extends Observable> |
getOnObservableAssembly()
Returns the current hook function.
| ||||||||||
static BiFunction<? super Observable, ? super Observer, ? extends Observer> |
getOnObservableSubscribe()
Returns the current hook function.
| ||||||||||
static Function<? super ParallelFlowable, ? extends ParallelFlowable> |
getOnParallelAssembly()
Returns the current hook function.
| ||||||||||
static Function<? super Single, ? extends Single> |
getOnSingleAssembly()
Returns the current hook function.
| ||||||||||
static BiFunction<? super Single, ? super SingleObserver, ? extends SingleObserver> |
getOnSingleSubscribe()
Returns the current hook function.
| ||||||||||
static Function<? super Runnable, ? extends Runnable> |
getScheduleHandler()
Returns the current hook function.
| ||||||||||
static Function<? super Scheduler, ? extends Scheduler> |
getSingleSchedulerHandler()
Returns the current hook function.
| ||||||||||
static Scheduler |
initComputationScheduler(Callable<Scheduler> defaultScheduler)
Calls the associated hook function.
| ||||||||||
static Scheduler |
initIoScheduler(Callable<Scheduler> defaultScheduler)
Calls the associated hook function.
| ||||||||||
static Scheduler |
initNewThreadScheduler(Callable<Scheduler> defaultScheduler)
Calls the associated hook function.
| ||||||||||
static Scheduler |
initSingleScheduler(Callable<Scheduler> defaultScheduler)
Calls the associated hook function.
| ||||||||||
static boolean |
isFailOnNonBlockingScheduler()
Returns true if the blockingX operators fail
with an IllegalStateException on a non-blocking scheduler
such as computation or single.
| ||||||||||
static boolean |
isLockdown()
Returns true if the plugins were locked down.
| ||||||||||
static void |
lockdown()
Prevents changing the plugins from then on.
| ||||||||||
static <T> Single<T> |
onAssembly(Single<T> source)
Calls the associated hook function.
| ||||||||||
static <T> Observable<T> |
onAssembly(Observable<T> source)
Calls the associated hook function.
| ||||||||||
static <T> ConnectableFlowable<T> |
onAssembly(ConnectableFlowable<T> source)
Calls the associated hook function.
| ||||||||||
static <T> Flowable<T> |
onAssembly(Flowable<T> source)
Calls the associated hook function.
| ||||||||||
static <T> ParallelFlowable<T> |
onAssembly(ParallelFlowable<T> source)
Calls the associated hook function.
| ||||||||||
static <T> Maybe<T> |
onAssembly(Maybe<T> source)
Calls the associated hook function.
| ||||||||||
static Completable |
onAssembly(Completable source)
Calls the associated hook function.
| ||||||||||
static <T> ConnectableObservable<T> |
onAssembly(ConnectableObservable<T> source)
Calls the associated hook function.
| ||||||||||
static boolean |
onBeforeBlocking()
Called before an operator attempts a blocking operation
such as awaiting a condition or signal
and should return true to indicate the operator
should not block but throw an IllegalArgumentException.
| ||||||||||
static Scheduler |
onComputationScheduler(Scheduler defaultScheduler)
Calls the associated hook function.
| ||||||||||
static void |
onError(Throwable error)
Called when an undeliverable error occurs.
| ||||||||||
static Scheduler |
onIoScheduler(Scheduler defaultScheduler)
Calls the associated hook function.
| ||||||||||
static Scheduler |
onNewThreadScheduler(Scheduler defaultScheduler)
Calls the associated hook function.
| ||||||||||
static Runnable |
onSchedule(Runnable run)
Called when a task is scheduled.
| ||||||||||
static Scheduler |
onSingleScheduler(Scheduler defaultScheduler)
Calls the associated hook function.
| ||||||||||
static CompletableObserver |
onSubscribe(Completable source, CompletableObserver observer)
Calls the associated hook function.
| ||||||||||
static <T> MaybeObserver<? super T> |
onSubscribe(Maybe<T> source, MaybeObserver<? super T> subscriber)
Calls the associated hook function.
| ||||||||||
static <T> Subscriber<? super T> |
onSubscribe(Flowable<T> source, Subscriber<? super T> subscriber)
Calls the associated hook function.
| ||||||||||
static <T> Observer<? super T> |
onSubscribe(Observable<T> source, Observer<? super T> observer)
Calls the associated hook function.
| ||||||||||
static <T> SingleObserver<? super T> |
onSubscribe(Single<T> source, SingleObserver<? super T> observer)
Calls the associated hook function.
| ||||||||||
static void |
reset()
Removes all handlers and resets to default behavior.
| ||||||||||
static void |
setComputationSchedulerHandler(Function<? super Scheduler, ? extends Scheduler> handler)
Sets the specific hook function.
| ||||||||||
static void |
setErrorHandler(Consumer<? super Throwable> handler)
Sets the specific hook function.
| ||||||||||
static void |
setFailOnNonBlockingScheduler(boolean enable)
Enables or disables the blockingX operators to fail
with an IllegalStateException on a non-blocking
scheduler such as computation or single.
| ||||||||||
static void |
setInitComputationSchedulerHandler(Function<? super Callable<Scheduler>, ? extends Scheduler> handler)
Sets the specific hook function.
| ||||||||||
static void |
setInitIoSchedulerHandler(Function<? super Callable<Scheduler>, ? extends Scheduler> handler)
Sets the specific hook function.
| ||||||||||
static void |
setInitNewThreadSchedulerHandler(Function<? super Callable<Scheduler>, ? extends Scheduler> handler)
Sets the specific hook function.
| ||||||||||
static void |
setInitSingleSchedulerHandler(Function<? super Callable<Scheduler>, ? extends Scheduler> handler)
Sets the specific hook function.
| ||||||||||
static void |
setIoSchedulerHandler(Function<? super Scheduler, ? extends Scheduler> handler)
Sets the specific hook function.
| ||||||||||
static void |
setNewThreadSchedulerHandler(Function<? super Scheduler, ? extends Scheduler> handler)
Sets the specific hook function.
| ||||||||||
static void |
setOnBeforeBlocking(BooleanSupplier handler)
Set the handler that is called when an operator attempts a blocking
await; the handler should return true to prevent the blocking
and to signal an IllegalStateException instead.
| ||||||||||
static void |
setOnCompletableAssembly(Function<? super Completable, ? extends Completable> onCompletableAssembly)
Sets the specific hook function.
| ||||||||||
static void |
setOnCompletableSubscribe(BiFunction<? super Completable, ? super CompletableObserver, ? extends CompletableObserver> onCompletableSubscribe)
Sets the specific hook function.
| ||||||||||
static void |
setOnConnectableFlowableAssembly(Function<? super ConnectableFlowable, ? extends ConnectableFlowable> onConnectableFlowableAssembly)
Sets the specific hook function.
| ||||||||||
static void |
setOnConnectableObservableAssembly(Function<? super ConnectableObservable, ? extends ConnectableObservable> onConnectableObservableAssembly)
Sets the specific hook function.
| ||||||||||
static void |
setOnFlowableAssembly(Function<? super Flowable, ? extends Flowable> onFlowableAssembly)
Sets the specific hook function.
| ||||||||||
static void |
setOnFlowableSubscribe(BiFunction<? super Flowable, ? super Subscriber, ? extends Subscriber> onFlowableSubscribe)
Sets the specific hook function.
| ||||||||||
static void |
setOnMaybeAssembly(Function<? super Maybe, ? extends Maybe> onMaybeAssembly)
Sets the specific hook function.
| ||||||||||
static void |
setOnMaybeSubscribe(BiFunction<? super Maybe, MaybeObserver, ? extends MaybeObserver> onMaybeSubscribe)
Sets the specific hook function.
| ||||||||||
static void |
setOnObservableAssembly(Function<? super Observable, ? extends Observable> onObservableAssembly)
Sets the specific hook function.
| ||||||||||
static void |
setOnObservableSubscribe(BiFunction<? super Observable, ? super Observer, ? extends Observer> onObservableSubscribe)
Sets the specific hook function.
| ||||||||||
static void |
setOnParallelAssembly(Function<? super ParallelFlowable, ? extends ParallelFlowable> handler)
Sets the specific hook function.
| ||||||||||
static void |
setOnSingleAssembly(Function<? super Single, ? extends Single> onSingleAssembly)
Sets the specific hook function.
| ||||||||||
static void |
setOnSingleSubscribe(BiFunction<? super Single, ? super SingleObserver, ? extends SingleObserver> onSingleSubscribe)
Sets the specific hook function.
| ||||||||||
static void |
setScheduleHandler(Function<? super Runnable, ? extends Runnable> handler)
Sets the specific hook function.
| ||||||||||
static void |
setSingleSchedulerHandler(Function<? super Scheduler, ? extends Scheduler> handler)
Sets the specific hook function.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Create an instance of the default Scheduler
used for computation()
except using threadFactory
for thread creation.
History: 2.0.5 - experimental
threadFactory | thread factory to use for creating worker threads. Note that this takes precedence over any system properties for configuring new thread creation. Cannot be null. |
---|
Create an instance of the default Scheduler
used for io()
except using threadFactory
for thread creation.
History: 2.0.5 - experimental
threadFactory | thread factory to use for creating worker threads. Note that this takes precedence over any system properties for configuring new thread creation. Cannot be null. |
---|
Create an instance of the default Scheduler
used for newThread()
except using threadFactory
for thread creation.
History: 2.0.5 - experimental
threadFactory | thread factory to use for creating worker threads. Note that this takes precedence over any system properties for configuring new thread creation. Cannot be null. |
---|
Create an instance of the default Scheduler
used for single()
except using threadFactory
for thread creation.
History: 2.0.5 - experimental
threadFactory | thread factory to use for creating worker threads. Note that this takes precedence over any system properties for configuring new thread creation. Cannot be null. |
---|
Returns the current hook function.
Returns the a hook consumer.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current blocking handler or null if no custom handler is set.
History: 2.0.5 - experimental
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
History: 2.0.6 - experimental
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Returns the current hook function.
Calls the associated hook function.
defaultScheduler | a Callable which returns the hook's input value |
---|
NullPointerException | if the callable parameter or its result are null |
---|
Calls the associated hook function.
defaultScheduler | a Callable which returns the hook's input value |
---|
NullPointerException | if the callable parameter or its result are null |
---|
Calls the associated hook function.
defaultScheduler | a Callable which returns the hook's input value |
---|
NullPointerException | if the callable parameter or its result are null |
---|
Calls the associated hook function.
defaultScheduler | a Callable which returns the hook's input value |
---|
NullPointerException | if the callable parameter or its result are null |
---|
Returns true if the blockingX operators fail with an IllegalStateException on a non-blocking scheduler such as computation or single.
History: 2.0.5 - experimental
Returns true if the plugins were locked down.
Prevents changing the plugins from then on.
This allows container-like environments to prevent clients messing with plugins.
Calls the associated hook function.
source | the hook's input value |
---|
Calls the associated hook function.
source | the hook's input value |
---|
Calls the associated hook function.
source | the hook's input value |
---|
Calls the associated hook function.
source | the hook's input value |
---|
Calls the associated hook function.
History: 2.0.6 - experimental
source | the hook's input value |
---|
Calls the associated hook function.
source | the hook's input value |
---|
Calls the associated hook function.
source | the hook's input value |
---|
Calls the associated hook function.
source | the hook's input value |
---|
Called before an operator attempts a blocking operation such as awaiting a condition or signal and should return true to indicate the operator should not block but throw an IllegalArgumentException.
History: 2.0.5 - experimental
Calls the associated hook function.
defaultScheduler | the hook's input value |
---|
Called when an undeliverable error occurs.
error | the error to report |
---|
Calls the associated hook function.
defaultScheduler | the hook's input value |
---|
Calls the associated hook function.
defaultScheduler | the hook's input value |
---|
Called when a task is scheduled.
run | the runnable instance |
---|
Calls the associated hook function.
defaultScheduler | the hook's input value |
---|
Calls the associated hook function.
source | the hook's input value |
---|---|
observer | the observer |
Calls the associated hook function.
source | the hook's input value |
---|---|
subscriber | the subscriber |
Calls the associated hook function.
source | the hook's input value |
---|---|
subscriber | the subscriber |
Calls the associated hook function.
source | the hook's input value |
---|---|
observer | the observer |
Calls the associated hook function.
source | the hook's input value |
---|---|
observer | the observer |
Removes all handlers and resets to default behavior.
Sets the specific hook function.
handler | the hook function to set, null allowed |
---|
Sets the specific hook function.
handler | the hook function to set, null allowed |
---|
Enables or disables the blockingX operators to fail with an IllegalStateException on a non-blocking scheduler such as computation or single.
History: 2.0.5 - experimental
enable | enable or disable the feature |
---|
Sets the specific hook function.
handler | the hook function to set, null allowed, but the function may not return null |
---|
Sets the specific hook function.
handler | the hook function to set, null allowed, but the function may not return null |
---|
Sets the specific hook function.
handler | the hook function to set, null allowed, but the function may not return null |
---|
Sets the specific hook function.
handler | the hook function to set, null allowed, but the function may not return null |
---|
Sets the specific hook function.
handler | the hook function to set, null allowed |
---|
Sets the specific hook function.
handler | the hook function to set, null allowed |
---|
Set the handler that is called when an operator attempts a blocking await; the handler should return true to prevent the blocking and to signal an IllegalStateException instead.
History: 2.0.5 - experimental
handler | the handler to set, null resets to the default handler that always returns false |
---|
Sets the specific hook function.
onCompletableAssembly | the hook function to set, null allowed |
---|
Sets the specific hook function.
onCompletableSubscribe | the hook function to set, null allowed |
---|
Sets the specific hook function.
onConnectableFlowableAssembly | the hook function to set, null allowed |
---|
Sets the specific hook function.
onConnectableObservableAssembly | the hook function to set, null allowed |
---|
Sets the specific hook function.
onFlowableAssembly | the hook function to set, null allowed |
---|
Sets the specific hook function.
onFlowableSubscribe | the hook function to set, null allowed |
---|
Sets the specific hook function.
onMaybeAssembly | the hook function to set, null allowed |
---|
Sets the specific hook function.
onMaybeSubscribe | the hook function to set, null allowed |
---|
Sets the specific hook function.
onObservableAssembly | the hook function to set, null allowed |
---|
Sets the specific hook function.
onObservableSubscribe | the hook function to set, null allowed |
---|
Sets the specific hook function.
History: 2.0.6 - experimental
handler | the hook function to set, null allowed |
---|
Sets the specific hook function.
onSingleAssembly | the hook function to set, null allowed |
---|
Sets the specific hook function.
onSingleSubscribe | the hook function to set, null allowed |
---|
Sets the specific hook function.
handler | the hook function to set, null allowed |
---|
Sets the specific hook function.
handler | the hook function to set, null allowed |
---|