public abstract class SingleThreadEventLoop extends SingleThreadEventExecutor implements EventLoop
EventLoop
s that execute all its submitted tasks in a single thread.Modifier | Constructor and Description |
---|---|
protected |
SingleThreadEventLoop(EventLoopGroup parent,
Executor executor,
boolean addTaskWakesUp) |
Modifier and Type | Method and Description |
---|---|
ChannelHandlerInvoker |
asInvoker()
Creates a new default
ChannelHandlerInvoker implementation that uses this EventLoop to
invoke event handler methods. |
EventLoop |
next()
Returns a reference to itself.
|
EventLoopGroup |
parent()
Return the
EventExecutorGroup which is the parent of this EventExecutor , |
ChannelFuture |
register(Channel channel)
|
ChannelFuture |
register(Channel channel,
ChannelPromise promise)
|
EventLoop |
unwrap()
Returns an
EventExecutor that is not a WrappedEventExecutor . |
protected boolean |
wakesUpForTask(Runnable task) |
addShutdownHook, addTask, awaitTermination, cleanup, cleanupAndTerminate, confirmShutdown, delayNanos, execute, hasTasks, inEventLoop, isShutdown, isShuttingDown, isTerminated, newTaskQueue, peekTask, pendingTasks, pollTask, reject, removeShutdownHook, removeTask, run, runAllTasks, runAllTasks, scheduleExecution, shutdown, shutdownGracefully, takeTask, terminationFuture, updateLastExecutionTime, wakeup
cancelScheduledTasks, hasScheduledTasks, nanoTime, nextScheduledTaskNano, pollScheduledTask, pollScheduledTask, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay
children, close, inEventLoop, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, newTaskFor, newTaskFor, shutdownGracefully, shutdownNow, submit, submit, submit
invokeAll, invokeAll, invokeAny, invokeAny
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
children, inEventLoop, inEventLoop, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture
isShuttingDown, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownGracefully, shutdownGracefully, shutdownNow, submit, submit, submit, terminationFuture
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated
close
protected SingleThreadEventLoop(EventLoopGroup parent, Executor executor, boolean addTaskWakesUp)
public EventLoopGroup parent()
EventExecutor
EventExecutorGroup
which is the parent of this EventExecutor
,parent
in interface EventLoop
parent
in interface EventExecutor
parent
in class AbstractEventExecutor
public EventLoop next()
EventExecutor
next
in interface EventLoopGroup
next
in interface EventExecutor
next
in interface EventExecutorGroup
next
in class AbstractEventExecutor
public ChannelHandlerInvoker asInvoker()
EventLoop
ChannelHandlerInvoker
implementation that uses this EventLoop
to
invoke event handler methods.public ChannelFuture register(Channel channel)
EventLoopGroup
Channel
with an EventLoop
from this EventLoopGroup
. The returned
ChannelFuture
will get notified once the registration is completed.
It's only safe to submit a new task to the EventLoop
from within a
ChannelHandler
once the ChannelPromise
succeeded. Otherwise
the task may or may not be rejected.
register
in interface EventLoopGroup
public ChannelFuture register(Channel channel, ChannelPromise promise)
EventLoopGroup
Channel
with an EventLoop
from this EventLoopGroup
. The provided
ChannelPromise
will get notified once the registration is completed. The returned ChannelFuture
is the same ChannelPromise
that was passed to the method.
It's only safe to submit a new task to the EventLoop
from within a
ChannelHandler
once the ChannelPromise
succeeded. Otherwise
the task may or may not be rejected.
register
in interface EventLoopGroup
protected boolean wakesUpForTask(Runnable task)
wakesUpForTask
in class SingleThreadEventExecutor
public EventLoop unwrap()
EventExecutor
EventExecutor
that is not a WrappedEventExecutor
.
WrappedEventExecutor
implementing this method must return the underlying
EventExecutor
while making sure that it's not a WrappedEventExecutor
(e.g. by multiple calls to EventExecutor.unwrap()
).
EventExecutor
that is not a WrappedEventExecutor
must return a reference to itself.
unwrap
in interface EventLoop
unwrap
in interface EventExecutor
unwrap
in class AbstractEventExecutor
Copyright © 2008–2015 The Netty Project. All rights reserved.