public abstract class SingleThreadEventLoop extends SingleThreadEventExecutor implements EventLoop
EventLoop
s that execute all its submitted tasks in a single thread.限定符和类型 | 类和说明 |
---|---|
protected static class |
SingleThreadEventLoop.ChannelsReadOnlyIterator<T extends Channel> |
SingleThreadEventExecutor.NonWakeupRunnable
AbstractEventExecutor.LazyRunnable
限定符和类型 | 字段和说明 |
---|---|
protected static int |
DEFAULT_MAX_PENDING_TASKS |
限定符 | 构造器和说明 |
---|---|
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.Executor executor,
boolean addTaskWakesUp,
java.util.Queue<java.lang.Runnable> taskQueue,
java.util.Queue<java.lang.Runnable> tailTaskQueue,
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) |
限定符和类型 | 方法和说明 |
---|---|
protected void |
afterRunningAllTasks()
Invoked before returning from
SingleThreadEventExecutor.runAllTasks() and SingleThreadEventExecutor.runAllTasks(long) . |
void |
executeAfterEventLoopIteration(java.lang.Runnable task)
Adds a task to be run once at the end of next (or current)
eventloop iteration. |
protected boolean |
hasTasks() |
EventLoop |
next()
Returns a reference to itself.
|
EventLoopGroup |
parent()
Return the
EventExecutorGroup which is the parent of this EventExecutor , |
int |
pendingTasks()
Return the number of tasks that are pending for processing.
|
ChannelFuture |
register(Channel channel)
|
ChannelFuture |
register(Channel channel,
ChannelPromise promise)
已过时。
|
ChannelFuture |
register(ChannelPromise promise)
|
int |
registeredChannels()
|
java.util.Iterator<Channel> |
registeredChannelsIterator() |
addShutdownHook, addTask, awaitTermination, cleanup, confirmShutdown, deadlineNanos, delayNanos, execute, inEventLoop, interruptThread, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isShuttingDown, isTerminated, lazyExecute, newTaskQueue, newTaskQueue, peekTask, pollTask, pollTaskFrom, reject, reject, removeShutdownHook, removeTask, run, runAllTasks, runAllTasks, runAllTasksFrom, runScheduledAndExecutorTasks, shutdown, shutdownGracefully, takeTask, terminationFuture, threadProperties, updateLastExecutionTime, wakesUpForTask, wakeup
afterScheduledTaskSubmitted, beforeScheduledTaskSubmitted, cancelScheduledTasks, deadlineToDelayNanos, getCurrentTimeNanos, hasScheduledTasks, initialNanoTime, nanoTime, nextScheduledTaskDeadlineNanos, nextScheduledTaskNano, pollScheduledTask, pollScheduledTask, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, validateScheduled
inEventLoop, iterator, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, newTaskFor, newTaskFor, runTask, 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)
protected SingleThreadEventLoop(EventLoopGroup parent, java.util.concurrent.Executor executor, boolean addTaskWakesUp, java.util.Queue<java.lang.Runnable> taskQueue, java.util.Queue<java.lang.Runnable> tailTaskQueue, RejectedExecutionHandler rejectedExecutionHandler)
public EventLoopGroup parent()
EventExecutor
EventExecutorGroup
which is the parent of this EventExecutor
,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
with this EventLoop
. The returned ChannelFuture
will get notified once the registration was complete.register
在接口中 EventLoopGroup
public ChannelFuture register(ChannelPromise promise)
EventLoopGroup
Channel
with this EventLoop
using a ChannelFuture
. The passed
ChannelFuture
will get notified once the registration was complete and also will get returned.register
在接口中 EventLoopGroup
@Deprecated public ChannelFuture register(Channel channel, ChannelPromise promise)
EventLoopGroup
Channel
with this EventLoop
. The passed ChannelFuture
will get notified once the registration was complete and also will get returned.register
在接口中 EventLoopGroup
@UnstableApi public final void executeAfterEventLoopIteration(java.lang.Runnable task)
eventloop
iteration.task
- to be added.protected void afterRunningAllTasks()
SingleThreadEventExecutor
SingleThreadEventExecutor.runAllTasks()
and SingleThreadEventExecutor.runAllTasks(long)
.protected boolean hasTasks()
hasTasks
在类中 SingleThreadEventExecutor
Collection.isEmpty()
public int pendingTasks()
SingleThreadEventExecutor
@UnstableApi public int registeredChannels()
@UnstableApi public java.util.Iterator<Channel> registeredChannelsIterator()
Channel
s registered with this EventLoop
.
The returned value is not guaranteed to be exact accurate and
should be viewed as a best effort. This method is expected to be called from within
event loop.java.lang.UnsupportedOperationException
- if operation is not supported by implementation.