@Test(timeout = 10000) public void testOnEventLoopIteration() throws Exception { CountingRunnable onIteration = new CountingRunnable(); loopC.executeAfterEventLoopIteration(onIteration); CountingRunnable noopTask = new CountingRunnable(); loopC.submit(noopTask).sync(); loopC.iterationEndSignal.take(); MatcherAssert.assertThat("Unexpected invocation count for regular task.", noopTask.getInvocationCount(), is(1)); MatcherAssert.assertThat("Unexpected invocation count for on every eventloop iteration task.", onIteration.getInvocationCount(), is(1)); }
@UnstableApi public final void executeAfterEventLoopIteration(Runnable task) { ObjectUtil.checkNotNull(task, "task"); if (isShutdown()) { reject(); } if (!tailTasks.offer(task)) { reject(task); } if (wakesUpForTask(task)) { wakeup(inEventLoop()); } }
SingleThreadEventLoop extends SingleThreadEventExecutor implements EventLoop { @UnstableApi public final void executeAfterEventLoopIteration(Runnable task) { ObjectUtil.checkNotNull(task, "task"); if (isShutdown()) { reject(); } if (!tailTasks.offer(task)) { reject(task); } if (wakesUpForTask(task)) { wakeup(inEventLoop()); } } }
SingleThreadEventLoop extends SingleThreadEventExecutor implements EventLoop { @UnstableApi public final void executeAfterEventLoopIteration(Runnable task) { ObjectUtil.checkNotNull(task, "task"); if (isShutdown()) { reject(); } if (!tailTasks.offer(task)) { reject(task); } if (wakesUpForTask(task)) { wakeup(inEventLoop()); } } protected  SingleThreadEventLoop(EventLoopGroup parent, ThreadFactory threadFactory, boolean addTaskWakesUp); protected  SingleThreadEventLoop(EventLoopGroup parent, Executor executor, boolean addTaskWakesUp); protected  SingleThreadEventLoop(EventLoopGroup parent, ThreadFactory threadFactory,
                                    boolean addTaskWakesUp, int maxPendingTasks,
                                    RejectedExecutionHandler rejectedExecutionHandler); protected  SingleThreadEventLoop(EventLoopGroup parent, Executor executor,
                                    boolean addTaskWakesUp, int maxPendingTasks,
                                    RejectedExecutionHandler rejectedExecutionHandler); }
SingleThreadEventLoop extends SingleThreadEventExecutor implements EventLoop { @UnstableApi public final void executeAfterEventLoopIteration(Runnable task) { ObjectUtil.checkNotNull(task, "task"); if (isShutdown()) { reject(); } if (!tailTasks.offer(task)) { reject(task); } if (wakesUpForTask(task)) { wakeup(inEventLoop()); } } protected  SingleThreadEventLoop(EventLoopGroup parent, ThreadFactory threadFactory, boolean addTaskWakesUp); protected  SingleThreadEventLoop(EventLoopGroup parent, Executor executor, boolean addTaskWakesUp); protected  SingleThreadEventLoop(EventLoopGroup parent, ThreadFactory threadFactory,
                                    boolean addTaskWakesUp, int maxPendingTasks,
                                    RejectedExecutionHandler rejectedExecutionHandler); protected  SingleThreadEventLoop(EventLoopGroup parent, Executor executor,
                                    boolean addTaskWakesUp, int maxPendingTasks,
                                    RejectedExecutionHandler rejectedExecutionHandler); @Override EventLoopGroup parent(); @Override EventLoop next(); @Override ChannelFuture register(Channel channel); @Override ChannelFuture register(final ChannelPromise promise); @Deprecated @Override ChannelFuture register(final Channel channel, final ChannelPromise promise); @UnstableApi final void executeAfterEventLoopIteration(Runnable task); @Override int pendingTasks(); }
SingleThreadEventLoop extends SingleThreadEventExecutor implements EventLoop { @UnstableApi public final void executeAfterEventLoopIteration(Runnable task) { ObjectUtil.checkNotNull(task, "task"); if (isShutdown()) { reject(); } if (!tailTasks.offer(task)) { reject(task); } if (wakesUpForTask(task)) { wakeup(inEventLoop()); } } protected  SingleThreadEventLoop(EventLoopGroup parent, ThreadFactory threadFactory, boolean addTaskWakesUp); protected  SingleThreadEventLoop(EventLoopGroup parent, Executor executor, boolean addTaskWakesUp); protected  SingleThreadEventLoop(EventLoopGroup parent, ThreadFactory threadFactory,
                                    boolean addTaskWakesUp, int maxPendingTasks,
                                    RejectedExecutionHandler rejectedExecutionHandler); protected  SingleThreadEventLoop(EventLoopGroup parent, Executor executor,
                                    boolean addTaskWakesUp, int maxPendingTasks,
                                    RejectedExecutionHandler rejectedExecutionHandler); @Override EventLoopGroup parent(); @Override EventLoop next(); @Override ChannelFuture register(Channel channel); @Override ChannelFuture register(final ChannelPromise promise); @Deprecated @Override ChannelFuture register(final Channel channel, final ChannelPromise promise); @UnstableApi final void executeAfterEventLoopIteration(Runnable task); @Override int pendingTasks();  }