/** * Create a delegating {@link EventLoopGroup} which reuse local event loop if already * working * inside one. * * @param group the {@link EventLoopGroup} to decorate * * @return a decorated {@link EventLoopGroup} that will colocate executions on the * same thread stack */ static EventLoopGroup colocate(EventLoopGroup group) { return new ColocatedEventLoopGroup(group); }
@Override public io.netty.util.concurrent.Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit) { clean(); return eventLoopGroup.shutdownGracefully(quietPeriod, timeout, unit); }
private boolean useEpoll(EventLoopGroup group) { if (group instanceof ColocatedEventLoopGroup) { group = ((ColocatedEventLoopGroup) group).get(); } return group instanceof EpollEventLoopGroup; }
@Override public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { return next().schedule(callable, delay, unit); }
@Deprecated @Override public void shutdown() { shutdownGracefully(); }
@Override public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return next().scheduleWithFixedDelay(command, initialDelay, delay, unit); }
@Deprecated @Override public void shutdown() { shutdownGracefully(); }
@Deprecated @Override public ChannelFuture register(Channel channel, ChannelPromise promise) { return next().register(channel, promise); }
@Override public io.netty.util.concurrent.Future<?> shutdownGracefully() { clean(); return eventLoopGroup.shutdownGracefully(); }
private boolean useKQueue(EventLoopGroup group) { if (group instanceof ColocatedEventLoopGroup) { group = ((ColocatedEventLoopGroup) group).get(); } return group instanceof KQueueEventLoopGroup; } }
/** * Create a delegating {@link EventLoopGroup} which reuse local event loop if already * working * inside one. * * @param group the {@link EventLoopGroup} to decorate * * @return a decorated {@link EventLoopGroup} that will colocate executions on the * same thread stack */ static EventLoopGroup colocate(EventLoopGroup group) { return new ColocatedEventLoopGroup(group); }
@Override public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException { return next().invokeAll(tasks, timeout, unit); }
@Override public io.netty.util.concurrent.Future<?> shutdownGracefully() { clean(); return eventLoopGroup.shutdownGracefully(); }
private boolean useKQueue(EventLoopGroup group) { if (group instanceof ColocatedEventLoopGroup) { group = ((ColocatedEventLoopGroup) group).get(); } return group instanceof KQueueEventLoopGroup; } }
@Override public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException { return next().invokeAny(tasks); }
@Override public io.netty.util.concurrent.Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit) { clean(); return eventLoopGroup.shutdownGracefully(quietPeriod, timeout, unit); }
private boolean useEpoll(EventLoopGroup group) { if (group instanceof ColocatedEventLoopGroup) { group = ((ColocatedEventLoopGroup) group).get(); } return group instanceof EpollEventLoopGroup; }
@Override public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) { return next().scheduleWithFixedDelay(command, initialDelay, delay, unit); }
@Override @Deprecated public List<Runnable> shutdownNow() { clean(); return eventLoopGroup.shutdownNow(); }
@Override public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { return next().schedule(callable, delay, unit); }