public abstract class SingleThreadEventLoop extends io.netty.util.concurrent.SingleThreadEventExecutor implements EventLoop
EventLoops that execute all its submitted tasks in a single thread.| Modifier and Type | Class and Description |
|---|---|
protected static class |
SingleThreadEventLoop.ChannelsReadOnlyIterator<T extends Channel> |
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_MAX_PENDING_TASKS |
| Modifier | Constructor and Description |
|---|---|
protected |
SingleThreadEventLoop(EventLoopGroup parent,
Executor executor,
boolean addTaskWakesUp) |
protected |
SingleThreadEventLoop(EventLoopGroup parent,
Executor executor,
boolean addTaskWakesUp,
int maxPendingTasks,
io.netty.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler) |
protected |
SingleThreadEventLoop(EventLoopGroup parent,
Executor executor,
boolean addTaskWakesUp,
Queue<Runnable> taskQueue,
Queue<Runnable> tailTaskQueue,
io.netty.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler) |
protected |
SingleThreadEventLoop(EventLoopGroup parent,
ThreadFactory threadFactory,
boolean addTaskWakesUp) |
protected |
SingleThreadEventLoop(EventLoopGroup parent,
ThreadFactory threadFactory,
boolean addTaskWakesUp,
int maxPendingTasks,
io.netty.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterRunningAllTasks() |
void |
executeAfterEventLoopIteration(Runnable task)
Adds a task to be run once at the end of next (or current)
eventloop iteration. |
protected boolean |
hasTasks() |
EventLoop |
next()
Return the next
EventLoop to use |
EventLoopGroup |
parent() |
int |
pendingTasks() |
ChannelFuture |
register(Channel channel)
|
ChannelFuture |
register(Channel channel,
ChannelPromise promise)
Deprecated.
|
ChannelFuture |
register(ChannelPromise promise)
|
int |
registeredChannels()
|
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, wakeupafterScheduledTaskSubmitted, beforeScheduledTaskSubmitted, cancelScheduledTasks, deadlineToDelayNanos, getCurrentTimeNanos, hasScheduledTasks, initialNanoTime, nanoTime, nextScheduledTaskDeadlineNanos, nextScheduledTaskNano, pollScheduledTask, pollScheduledTask, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, validateScheduledinEventLoop, iterator, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, newTaskFor, newTaskFor, runTask, 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, terminationFutureawaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminatedforEach, spliteratorprotected 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, io.netty.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler)
protected SingleThreadEventLoop(EventLoopGroup parent, Executor executor, boolean addTaskWakesUp, int maxPendingTasks, io.netty.util.concurrent.RejectedExecutionHandler rejectedExecutionHandler)
public EventLoopGroup parent()
public EventLoop next()
EventLoopGroupEventLoop to usenext in interface EventLoopGroupnext in interface io.netty.util.concurrent.EventExecutornext in interface io.netty.util.concurrent.EventExecutorGroupnext in class io.netty.util.concurrent.AbstractEventExecutorpublic ChannelFuture register(Channel channel)
EventLoopGroupChannel with this EventLoop. The returned ChannelFuture
will get notified once the registration was complete.register in interface EventLoopGrouppublic ChannelFuture register(ChannelPromise promise)
EventLoopGroupChannel with this EventLoop using a ChannelFuture. The passed
ChannelFuture will get notified once the registration was complete and also will get returned.register in interface EventLoopGroup@Deprecated public ChannelFuture register(Channel channel, ChannelPromise promise)
EventLoopGroupChannel with this EventLoop. The passed ChannelFuture
will get notified once the registration was complete and also will get returned.register in interface EventLoopGrouppublic final void executeAfterEventLoopIteration(Runnable task)
eventloop iteration.task - to be added.protected void afterRunningAllTasks()
afterRunningAllTasks in class io.netty.util.concurrent.SingleThreadEventExecutorprotected boolean hasTasks()
hasTasks in class io.netty.util.concurrent.SingleThreadEventExecutorpublic int pendingTasks()
pendingTasks in class io.netty.util.concurrent.SingleThreadEventExecutor@UnstableApi public int registeredChannels()
@UnstableApi public Iterator<Channel> registeredChannelsIterator()
Channels 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.UnsupportedOperationException - if operation is not supported by implementation.Copyright © 2008–2025 The Netty Project. All rights reserved.