public final class RxJavaFlowablePlugins
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static io.reactivex.common.Scheduler |
createComputationScheduler(java.util.concurrent.ThreadFactory threadFactory)
Create an instance of the default
Scheduler used for Schedulers.computation()
except using threadFactory for thread creation. |
static io.reactivex.common.Scheduler |
createIoScheduler(java.util.concurrent.ThreadFactory threadFactory)
Create an instance of the default
Scheduler used for Schedulers.io()
except using threadFactory for thread creation. |
static io.reactivex.common.Scheduler |
createNewThreadScheduler(java.util.concurrent.ThreadFactory threadFactory)
Create an instance of the default
Scheduler used for Schedulers.newThread()
except using threadFactory for thread creation. |
static io.reactivex.common.Scheduler |
createSingleScheduler(java.util.concurrent.ThreadFactory threadFactory)
Create an instance of the default
Scheduler used for Schedulers.single()
except using threadFactory for thread creation. |
static io.reactivex.common.functions.Function<? super ConnectableFlowable,? extends ConnectableFlowable> |
getOnConnectableFlowableAssembly()
Returns the current hook function.
|
static io.reactivex.common.functions.Function<? super Flowable,? extends Flowable> |
getOnFlowableAssembly()
Returns the current hook function.
|
static io.reactivex.common.functions.BiFunction<? super Flowable,? super org.reactivestreams.Subscriber,? extends org.reactivestreams.Subscriber> |
getOnFlowableSubscribe()
Returns the current hook function.
|
static io.reactivex.common.functions.Function<? super ParallelFlowable,? extends ParallelFlowable> |
getOnParallelAssembly()
Returns the current hook function.
|
static boolean |
isLockdown()
Returns true if the plugins were locked down.
|
static void |
lockdown()
Prevents changing the plugins from then on.
|
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> org.reactivestreams.Subscriber<? super T> |
onSubscribe(Flowable<T> source,
org.reactivestreams.Subscriber<? super T> subscriber)
Calls the associated hook function.
|
static void |
reset()
Removes all handlers and resets to default behavior.
|
static void |
setOnConnectableFlowableAssembly(io.reactivex.common.functions.Function<? super ConnectableFlowable,? extends ConnectableFlowable> onConnectableFlowableAssembly)
Sets the specific hook function.
|
static void |
setOnFlowableAssembly(io.reactivex.common.functions.Function<? super Flowable,? extends Flowable> onFlowableAssembly)
Sets the specific hook function.
|
static void |
setOnFlowableSubscribe(io.reactivex.common.functions.BiFunction<? super Flowable,? super org.reactivestreams.Subscriber,? extends org.reactivestreams.Subscriber> onFlowableSubscribe)
Sets the specific hook function.
|
static void |
setOnParallelAssembly(io.reactivex.common.functions.Function<? super ParallelFlowable,? extends ParallelFlowable> handler)
Sets the specific hook function.
|
public static void lockdown()
This allows container-like environments to prevent clients messing with plugins.
public static boolean isLockdown()
public static void reset()
@Nullable public static io.reactivex.common.functions.Function<? super Flowable,? extends Flowable> getOnFlowableAssembly()
@Nullable public static io.reactivex.common.functions.Function<? super ConnectableFlowable,? extends ConnectableFlowable> getOnConnectableFlowableAssembly()
@Nullable public static io.reactivex.common.functions.BiFunction<? super Flowable,? super org.reactivestreams.Subscriber,? extends org.reactivestreams.Subscriber> getOnFlowableSubscribe()
public static void setOnFlowableAssembly(@Nullable
io.reactivex.common.functions.Function<? super Flowable,? extends Flowable> onFlowableAssembly)
onFlowableAssembly - the hook function to set, null allowedpublic static void setOnConnectableFlowableAssembly(@Nullable
io.reactivex.common.functions.Function<? super ConnectableFlowable,? extends ConnectableFlowable> onConnectableFlowableAssembly)
onConnectableFlowableAssembly - the hook function to set, null allowedpublic static void setOnFlowableSubscribe(@Nullable
io.reactivex.common.functions.BiFunction<? super Flowable,? super org.reactivestreams.Subscriber,? extends org.reactivestreams.Subscriber> onFlowableSubscribe)
onFlowableSubscribe - the hook function to set, null allowed@NonNull
public static <T> org.reactivestreams.Subscriber<? super T> onSubscribe(@NonNull
Flowable<T> source,
@NonNull
org.reactivestreams.Subscriber<? super T> subscriber)
T - the value typesource - the hook's input valuesubscriber - the subscriber@NonNull public static <T> Flowable<T> onAssembly(@NonNull Flowable<T> source)
T - the value typesource - the hook's input value@NonNull public static <T> ConnectableFlowable<T> onAssembly(@NonNull ConnectableFlowable<T> source)
T - the value typesource - the hook's input valuepublic static void setOnParallelAssembly(@Nullable
io.reactivex.common.functions.Function<? super ParallelFlowable,? extends ParallelFlowable> handler)
handler - the hook function to set, null allowed@Nullable public static io.reactivex.common.functions.Function<? super ParallelFlowable,? extends ParallelFlowable> getOnParallelAssembly()
@NonNull public static <T> ParallelFlowable<T> onAssembly(@NonNull ParallelFlowable<T> source)
T - the value type of the sourcesource - the hook's input value@NonNull
public static io.reactivex.common.Scheduler createComputationScheduler(@NonNull
java.util.concurrent.ThreadFactory threadFactory)
Scheduler used for Schedulers.computation()
except using threadFactory for thread creation.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.@NonNull
public static io.reactivex.common.Scheduler createIoScheduler(@NonNull
java.util.concurrent.ThreadFactory threadFactory)
Scheduler used for Schedulers.io()
except using threadFactory for thread creation.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.@NonNull
public static io.reactivex.common.Scheduler createNewThreadScheduler(@NonNull
java.util.concurrent.ThreadFactory threadFactory)
Scheduler used for Schedulers.newThread()
except using threadFactory for thread creation.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.@NonNull
public static io.reactivex.common.Scheduler createSingleScheduler(@NonNull
java.util.concurrent.ThreadFactory threadFactory)
Scheduler used for Schedulers.single()
except using threadFactory for thread creation.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.