Java Code Examples for io.reactivex.plugins.RxJavaPlugins#setOnConnectableObservableAssembly()
The following examples show how to use
io.reactivex.plugins.RxJavaPlugins#setOnConnectableObservableAssembly() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RxJavaAssemblyTracking.java From RxJava2Debug with Apache License 2.0 | 6 votes |
/** * Disable the assembly tracking. */ public static void disable() { if (lock.compareAndSet(false, true)) { RxJavaPlugins.setOnCompletableAssembly(null); RxJavaPlugins.setOnSingleAssembly(null); RxJavaPlugins.setOnMaybeAssembly(null); RxJavaPlugins.setOnObservableAssembly(null); RxJavaPlugins.setOnFlowableAssembly(null); RxJavaPlugins.setOnConnectableObservableAssembly(null); RxJavaPlugins.setOnConnectableFlowableAssembly(null); RxJavaPlugins.setOnParallelAssembly(null); lock.set(false); } }
Example 2
Source File: RequestContextAssembly.java From armeria with Apache License 2.0 | 6 votes |
/** * Disable {@link RequestContext} during operators. */ public static synchronized void disable() { if (!enabled) { return; } RxJavaPlugins.setOnObservableAssembly(oldOnObservableAssembly); oldOnObservableAssembly = null; RxJavaPlugins.setOnConnectableObservableAssembly(oldOnConnectableObservableAssembly); oldOnConnectableObservableAssembly = null; RxJavaPlugins.setOnCompletableAssembly(oldOnCompletableAssembly); oldOnCompletableAssembly = null; RxJavaPlugins.setOnSingleAssembly(oldOnSingleAssembly); oldOnSingleAssembly = null; RxJavaPlugins.setOnMaybeAssembly(oldOnMaybeAssembly); oldOnMaybeAssembly = null; RxJavaPlugins.setOnFlowableAssembly(oldOnFlowableAssembly); oldOnFlowableAssembly = null; RxJavaPlugins.setOnConnectableFlowableAssembly(oldOnConnectableFlowableAssembly); oldOnConnectableFlowableAssembly = null; RxJavaPlugins.setOnParallelAssembly(oldOnParallelAssembly); oldOnParallelAssembly = null; enabled = false; }
Example 3
Source File: RxJavaHooksUnitTest.java From tutorials with MIT License | 5 votes |
@Test public void givenConnectableObservable_whenAssembled_shouldExecuteTheHook() { RxJavaPlugins.setOnConnectableObservableAssembly(connectableObservable -> { hookCalled = true; return connectableObservable; }); ConnectableObservable.range(1, 10) .publish() .connect(); assertTrue(hookCalled); }
Example 4
Source File: CurrentTraceContextAssemblyTracking.java From brave with Apache License 2.0 | 5 votes |
/** Disables the validation hooks be resetting the assembled hooks to none. */ public static void disable() { RxJavaPlugins.setOnCompletableAssembly(null); RxJavaPlugins.setOnSingleAssembly(null); RxJavaPlugins.setOnMaybeAssembly(null); RxJavaPlugins.setOnObservableAssembly(null); RxJavaPlugins.setOnFlowableAssembly(null); RxJavaPlugins.setOnConnectableObservableAssembly(null); RxJavaPlugins.setOnConnectableFlowableAssembly(null); RxJavaPlugins.setOnParallelAssembly(null); enabled = false; }