@Test public void testScheduleBigDelayNotOverflow() { EventLoopGroup group = new NioEventLoopGroup(1); final EventLoop el = group.next(); Future<?> future = el.schedule(new Runnable() { @Override public void run() { } }, Long.MAX_VALUE, TimeUnit.MILLISECONDS); assertFalse(future.awaitUninterruptibly(1000)); assertTrue(future.cancel(true)); group.shutdownGracefully(); }
void cancel(SelectionKey key) { key.cancel(); cancelledKeys ++; if (cancelledKeys >= CLEANUP_INTERVAL) { cancelledKeys = 0; needsToSelectAgain = true; } }
NioEventLoop extends SingleThreadEventLoop { void cancel(SelectionKey key) { key.cancel(); cancelledKeys ++; if (cancelledKeys >= CLEANUP_INTERVAL) { cancelledKeys = 0; needsToSelectAgain = true; } } }
NioEventLoop extends SingleThreadEventLoop { void cancel(SelectionKey key) { key.cancel(); cancelledKeys ++; if (cancelledKeys >= CLEANUP_INTERVAL) { cancelledKeys = 0; needsToSelectAgain = true; } } NioEventLoop(NioEventLoopGroup parent, Executor executor, SelectorProvider selectorProvider,
                 SelectStrategy strategy, RejectedExecutionHandler rejectedExecutionHandler); }
NioEventLoop extends SingleThreadEventLoop { void cancel(SelectionKey key) { key.cancel(); cancelledKeys ++; if (cancelledKeys >= CLEANUP_INTERVAL) { cancelledKeys = 0; needsToSelectAgain = true; } } NioEventLoop(NioEventLoopGroup parent, Executor executor, SelectorProvider selectorProvider,
                 SelectStrategy strategy, RejectedExecutionHandler rejectedExecutionHandler); SelectorProvider selectorProvider(); @Override int pendingTasks(); void register(final SelectableChannel ch, final int interestOps, final NioTask<?> task); int getIoRatio(); void setIoRatio(int ioRatio); void rebuildSelector(); }
NioEventLoop extends SingleThreadEventLoop { void cancel(SelectionKey key) { key.cancel(); cancelledKeys ++; if (cancelledKeys >= CLEANUP_INTERVAL) { cancelledKeys = 0; needsToSelectAgain = true; } } NioEventLoop(NioEventLoopGroup parent, Executor executor, SelectorProvider selectorProvider,
                 SelectStrategy strategy, RejectedExecutionHandler rejectedExecutionHandler); SelectorProvider selectorProvider(); @Override int pendingTasks(); void register(final SelectableChannel ch, final int interestOps, final NioTask<?> task); int getIoRatio(); void setIoRatio(int ioRatio); void rebuildSelector();  }