@Test public void testWrapExecutor() throws Exception { AsyncContext.put(K1, "v1"); Consumer<AsyncContextMap> verifier = map -> { assertEquals("v1", map.get(K1)); assertNull(map.get(K2)); }; new ContextCaptureRunnable() .runAndWait(INSTANCE.wrapJdkExecutor(executor)) .verifyContext(verifier); new ContextCaptureRunnable() .runAndWait(INSTANCE.wrapJdkExecutorService(executor)) .verifyContext(verifier); new ContextCaptureCallable<String>() .runAndWait(INSTANCE.wrapJdkExecutorService(executor)) .verifyContext(verifier); new ContextCaptureCallable<String>() .scheduleAndWait(INSTANCE.wrapJdkScheduledExecutorService(executor)) .verifyContext(verifier); }
@Override public io.servicetalk.concurrent.api.Executor wrapExecutor(final io.servicetalk.concurrent.api.Executor executor) { return ContextPreservingStExecutor.of(executor); }
DefaultAsyncContextProvider implements AsyncContextProvider { @Override public io.servicetalk.concurrent.api.Executor wrapExecutor(final io.servicetalk.concurrent.api.Executor executor) { return ContextPreservingStExecutor.of(executor); } }
DefaultAsyncContextProvider implements AsyncContextProvider { @Override public io.servicetalk.concurrent.api.Executor wrapExecutor(final io.servicetalk.concurrent.api.Executor executor) { return ContextPreservingStExecutor.of(executor); } private  DefaultAsyncContextProvider(); }
DefaultAsyncContextProvider implements AsyncContextProvider { @Override public io.servicetalk.concurrent.api.Executor wrapExecutor(final io.servicetalk.concurrent.api.Executor executor) { return ContextPreservingStExecutor.of(executor); } private  DefaultAsyncContextProvider(); @Override AsyncContextMap contextMap(); @Override void contextMap(AsyncContextMap newContextMap); @Override CompletableSource.Subscriber wrapCancellable(final CompletableSource.Subscriber subscriber,
                                                        final AsyncContextMap current); @Override CompletableSource.Subscriber wrapCompletableSubscriber(CompletableSource.Subscriber subscriber,
                                                                  AsyncContextMap current); @Override CompletableSource.Subscriber wrapCompletableSubscriberAndCancellable(
            final CompletableSource.Subscriber subscriber, final AsyncContextMap current); @Override SingleSource.Subscriber<T> wrapCancellable(final SingleSource.Subscriber<T> subscriber,
                                                          final AsyncContextMap current); @Override SingleSource.Subscriber<T> wrapSingleSubscriber(SingleSource.Subscriber<T> subscriber,
                                                               AsyncContextMap current); @Override SingleSource.Subscriber<T> wrapSingleSubscriberAndCancellable(
            final SingleSource.Subscriber<T> subscriber, final AsyncContextMap current); @Override Subscriber<T> wrapSubscription(final Subscriber<T> subscriber, final AsyncContextMap current); @Override Subscriber<T> wrapPublisherSubscriber(Subscriber<T> subscriber, AsyncContextMap current); @Override Subscriber<T> wrapPublisherSubscriberAndSubscription(final Subscriber<T> subscriber,
                                                                    final AsyncContextMap current); @Override Executor wrapJdkExecutor(Executor executor); @Override ExecutorService wrapJdkExecutorService(ExecutorService executor); @Override io.servicetalk.concurrent.api.Executor wrapExecutor(final io.servicetalk.concurrent.api.Executor executor); @Override CompletableFuture<T> wrapCompletableFuture(final CompletableFuture<T> future, AsyncContextMap current); @Override ScheduledExecutorService wrapJdkScheduledExecutorService(ScheduledExecutorService executor); @Override Runnable wrapRunnable(final Runnable runnable, final AsyncContextMap contextMap); @Override Consumer<T> wrapConsumer(final Consumer<T> consumer, final AsyncContextMap contextMap); @Override Function<T, U> wrapFunction(Function<T, U> func, AsyncContextMap contextMap); @Override BiConsumer<T, U> wrapBiConsumer(BiConsumer<T, U> consumer, AsyncContextMap contextMap); @Override BiFunction<T, U, V> wrapBiFunction(BiFunction<T, U, V> func, AsyncContextMap contextMap); }
DefaultAsyncContextProvider implements AsyncContextProvider { @Override public io.servicetalk.concurrent.api.Executor wrapExecutor(final io.servicetalk.concurrent.api.Executor executor) { return ContextPreservingStExecutor.of(executor); } private  DefaultAsyncContextProvider(); @Override AsyncContextMap contextMap(); @Override void contextMap(AsyncContextMap newContextMap); @Override CompletableSource.Subscriber wrapCancellable(final CompletableSource.Subscriber subscriber,
                                                        final AsyncContextMap current); @Override CompletableSource.Subscriber wrapCompletableSubscriber(CompletableSource.Subscriber subscriber,
                                                                  AsyncContextMap current); @Override CompletableSource.Subscriber wrapCompletableSubscriberAndCancellable(
            final CompletableSource.Subscriber subscriber, final AsyncContextMap current); @Override SingleSource.Subscriber<T> wrapCancellable(final SingleSource.Subscriber<T> subscriber,
                                                          final AsyncContextMap current); @Override SingleSource.Subscriber<T> wrapSingleSubscriber(SingleSource.Subscriber<T> subscriber,
                                                               AsyncContextMap current); @Override SingleSource.Subscriber<T> wrapSingleSubscriberAndCancellable(
            final SingleSource.Subscriber<T> subscriber, final AsyncContextMap current); @Override Subscriber<T> wrapSubscription(final Subscriber<T> subscriber, final AsyncContextMap current); @Override Subscriber<T> wrapPublisherSubscriber(Subscriber<T> subscriber, AsyncContextMap current); @Override Subscriber<T> wrapPublisherSubscriberAndSubscription(final Subscriber<T> subscriber,
                                                                    final AsyncContextMap current); @Override Executor wrapJdkExecutor(Executor executor); @Override ExecutorService wrapJdkExecutorService(ExecutorService executor); @Override io.servicetalk.concurrent.api.Executor wrapExecutor(final io.servicetalk.concurrent.api.Executor executor); @Override CompletableFuture<T> wrapCompletableFuture(final CompletableFuture<T> future, AsyncContextMap current); @Override ScheduledExecutorService wrapJdkScheduledExecutorService(ScheduledExecutorService executor); @Override Runnable wrapRunnable(final Runnable runnable, final AsyncContextMap contextMap); @Override Consumer<T> wrapConsumer(final Consumer<T> consumer, final AsyncContextMap contextMap); @Override Function<T, U> wrapFunction(Function<T, U> func, AsyncContextMap contextMap); @Override BiConsumer<T, U> wrapBiConsumer(BiConsumer<T, U> consumer, AsyncContextMap contextMap); @Override BiFunction<T, U, V> wrapBiFunction(BiFunction<T, U, V> func, AsyncContextMap contextMap);  }