@Test public void cancelExecute() throws Throwable { assumeTrue("Ignoring executor: " + name + ", it does not support cancellation.", supportsCancellation); CountDownLatch latch = new CountDownLatch(1); Task awaitTillCancelled = Task.awaitFor(latch); Cancellable cancellable = executor.execute(awaitTillCancelled); awaitTillCancelled.awaitStart(); cancellable.cancel(); expected.expectCause(instanceOf(InterruptedException.class)); awaitTillCancelled.awaitDone(); }
@Override public Cancellable execute(Runnable task) { return executor.apply(task); }
DefaultExecutor extends AbstractOffloaderAwareExecutor implements Consumer<Runnable> { @Override public Cancellable execute(Runnable task) { return executor.apply(task); } }
DefaultExecutor extends AbstractOffloaderAwareExecutor implements Consumer<Runnable> { @Override public Cancellable execute(Runnable task) { return executor.apply(task); } DefaultExecutor(int coreSize, int maxSize, ThreadFactory threadFactory);   DefaultExecutor(java.util.concurrent.Executor jdkExecutor);   DefaultExecutor(java.util.concurrent.Executor jdkExecutor, boolean interruptOnCancel);   DefaultExecutor(java.util.concurrent.Executor jdkExecutor, ScheduledExecutorService scheduler);   DefaultExecutor(java.util.concurrent.Executor jdkExecutor, ScheduledExecutorService scheduler,
                    boolean interruptOnCancel); private  DefaultExecutor(@Nullable java.util.concurrent.Executor jdkExecutor, @Nullable InternalScheduler scheduler,
                            boolean interruptOnCancel); }
DefaultExecutor extends AbstractOffloaderAwareExecutor implements Consumer<Runnable> { @Override public Cancellable execute(Runnable task) { return executor.apply(task); } DefaultExecutor(int coreSize, int maxSize, ThreadFactory threadFactory);   DefaultExecutor(java.util.concurrent.Executor jdkExecutor);   DefaultExecutor(java.util.concurrent.Executor jdkExecutor, boolean interruptOnCancel);   DefaultExecutor(java.util.concurrent.Executor jdkExecutor, ScheduledExecutorService scheduler);   DefaultExecutor(java.util.concurrent.Executor jdkExecutor, ScheduledExecutorService scheduler,
                    boolean interruptOnCancel); private  DefaultExecutor(@Nullable java.util.concurrent.Executor jdkExecutor, @Nullable InternalScheduler scheduler,
                            boolean interruptOnCancel); @Override Cancellable execute(Runnable task); @Override Cancellable schedule(final Runnable task, final long duration, final TimeUnit unit); @Override SignalOffloader newSignalOffloader(final io.servicetalk.concurrent.Executor executor); @Override boolean hasThreadAffinity(); @Override void accept(final Runnable runnable); }
DefaultExecutor extends AbstractOffloaderAwareExecutor implements Consumer<Runnable> { @Override public Cancellable execute(Runnable task) { return executor.apply(task); } DefaultExecutor(int coreSize, int maxSize, ThreadFactory threadFactory);   DefaultExecutor(java.util.concurrent.Executor jdkExecutor);   DefaultExecutor(java.util.concurrent.Executor jdkExecutor, boolean interruptOnCancel);   DefaultExecutor(java.util.concurrent.Executor jdkExecutor, ScheduledExecutorService scheduler);   DefaultExecutor(java.util.concurrent.Executor jdkExecutor, ScheduledExecutorService scheduler,
                    boolean interruptOnCancel); private  DefaultExecutor(@Nullable java.util.concurrent.Executor jdkExecutor, @Nullable InternalScheduler scheduler,
                            boolean interruptOnCancel); @Override Cancellable execute(Runnable task); @Override Cancellable schedule(final Runnable task, final long duration, final TimeUnit unit); @Override SignalOffloader newSignalOffloader(final io.servicetalk.concurrent.Executor executor); @Override boolean hasThreadAffinity(); @Override void accept(final Runnable runnable);  }