public abstract class SingleThreadEventLoop extends SingleThreadEventExecutor implements EventLoop
EventLoop的抽象基类,在单个线程中执行其所有提交的任务。
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_MAX_PENDING_TASKS |
| Modifier | Constructor and Description |
|---|---|
protected |
SingleThreadEventLoop(EventLoopGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp) |
protected |
SingleThreadEventLoop(EventLoopGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp, int maxPendingTasks, RejectedExecutionHandler rejectedExecutionHandler) |
protected |
SingleThreadEventLoop(EventLoopGroup parent, java.util.concurrent.ThreadFactory threadFactory, boolean addTaskWakesUp) |
protected |
SingleThreadEventLoop(EventLoopGroup parent, java.util.concurrent.ThreadFactory threadFactory, boolean addTaskWakesUp, int maxPendingTasks, RejectedExecutionHandler rejectedExecutionHandler) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterRunningAllTasks()
|
void |
executeAfterEventLoopIteration(java.lang.Runnable task)
添加要在下一次(或电流)结束运行一次任务
eventloop迭代。
|
protected boolean |
hasTasks() |
EventLoop |
next()
返回对自身的引用。
|
EventLoopGroup |
parent()
返回这个 EventExecutor的父亲的EventExecutorGroup ,
|
int |
pendingTasks()
返回待处理任务的数量。
|
ChannelFuture |
register(Channel channel)
|
ChannelFuture |
register(Channel channel, ChannelPromise promise)
已过时。
|
ChannelFuture |
register(ChannelPromise promise)
使用 ChannelFuture通过此EventLoop注册一个Channel 。
|
protected boolean |
wakesUpForTask(java.lang.Runnable task) |
addShutdownHook, addTask, awaitTermination, cleanup, confirmShutdown, delayNanos, execute, inEventLoop, interruptThread, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isShuttingDown, isTerminated, newTaskQueue, newTaskQueue, peekTask, pollTask, pollTaskFrom, reject, reject, removeShutdownHook, removeTask, run, runAllTasks, runAllTasks, runAllTasksFrom, shutdown, shutdownGracefully, takeTask, terminationFuture, threadProperties, updateLastExecutionTime, wakeupcancelScheduledTasks, hasScheduledTasks, nanoTime, nextScheduledTaskNano, pollScheduledTask, pollScheduledTask, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelayinEventLoop, iterator, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, newTaskFor, newTaskFor, safeExecute, shutdownGracefully, shutdownNow, submit, submit, submitclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinEventLoop, inEventLoop, newFailedFuture, newProgressivePromise, newPromise, newSucceededFutureisShuttingDown, iterator, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownGracefully, shutdownGracefully, shutdownNow, submit, submit, submit, terminationFutureprotected SingleThreadEventLoop(EventLoopGroup parent, java.util.concurrent.ThreadFactory threadFactory, boolean addTaskWakesUp)
protected SingleThreadEventLoop(EventLoopGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp)
protected SingleThreadEventLoop(EventLoopGroup parent, java.util.concurrent.ThreadFactory threadFactory, boolean addTaskWakesUp, int maxPendingTasks, RejectedExecutionHandler rejectedExecutionHandler)
protected SingleThreadEventLoop(EventLoopGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp, int maxPendingTasks, RejectedExecutionHandler rejectedExecutionHandler)
public EventLoopGroup parent()
EventExecutor复制的描述
EventExecutor的母公司的EventExecutorGroup ,
parent在界面
EventLoop
parent在界面
EventExecutor
parent在课堂上
AbstractEventExecutor
public EventLoop next()
EventExecutor
next在界面
EventLoopGroup
next在界面
EventExecutor
next在界面
EventExecutorGroup
next在课堂上
AbstractEventExecutor
public ChannelFuture register(Channel channel)
EventLoopGroup
Channel这个EventLoop 。
一旦注册完成,返回的ChannelFuture将会收到通知。
register在界面
EventLoopGroup
public ChannelFuture register(ChannelPromise promise)
EventLoopGroup
Channel这个EventLoop使用ChannelFuture 。
一旦注册完成,通过的ChannelFuture将会收到通知,并且还会返回。
register在界面
EventLoopGroup
@Deprecated public ChannelFuture register(Channel channel, ChannelPromise promise)
EventLoopGroup
Channel这个EventLoop 。
一旦注册完成,通过的ChannelFuture将会收到通知,并且会返回。
register ,界面
EventLoopGroup
@UnstableApi public final void executeAfterEventLoopIteration(java.lang.Runnable task)
eventloop迭代。
task - 待补充。
protected boolean wakesUpForTask(java.lang.Runnable task)
protected void afterRunningAllTasks()
SingleThreadEventExecutor
protected boolean hasTasks()
hasTasks在课堂上
SingleThreadEventExecutor
Collection.isEmpty()
public int pendingTasks()
SingleThreadEventExecutor
pendingTasks in class
SingleThreadEventExecutor
Copyright © 2008–2018 The Netty Project. All rights reserved.