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, wakeup
cancelScheduledTasks, hasScheduledTasks, nanoTime, nextScheduledTaskNano, pollScheduledTask, pollScheduledTask, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay
inEventLoop, iterator, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, newTaskFor, newTaskFor, safeExecute, shutdownGracefully, shutdownNow, submit, submit, submit
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
inEventLoop, inEventLoop, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture
isShuttingDown, iterator, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownGracefully, shutdownGracefully, shutdownNow, submit, submit, submit, terminationFuture
protected 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.