public final class NioEventLoop extends SingleThreadEventLoop
SingleThreadEventLoop implementation which register the Channel's to a
Selector and so does the multi-plexing of these in the event loop.SingleThreadEventLoop.ChannelsReadOnlyIterator<T extends Channel>DEFAULT_MAX_PENDING_TASKS| Modifier and Type | Method and Description |
|---|---|
protected boolean |
afterScheduledTaskSubmitted(long deadlineNanos) |
protected boolean |
beforeScheduledTaskSubmitted(long deadlineNanos) |
protected void |
cleanup() |
int |
getIoRatio()
Returns the percentage of the desired amount of time spent for I/O in the event loop.
|
protected Queue<Runnable> |
newTaskQueue(int maxPendingTasks) |
void |
rebuildSelector()
|
void |
register(SelectableChannel ch,
int interestOps,
NioTask<?> task)
Registers an arbitrary
SelectableChannel, not necessarily created by Netty, to the Selector
of this event loop. |
int |
registeredChannels()
|
Iterator<Channel> |
registeredChannelsIterator() |
protected void |
run() |
SelectorProvider |
selectorProvider()
|
void |
setIoRatio(int ioRatio)
Sets the percentage of the desired amount of time spent for I/O in the event loop.
|
protected void |
wakeup(boolean inEventLoop) |
afterRunningAllTasks, executeAfterEventLoopIteration, hasTasks, next, parent, pendingTasks, register, register, registeraddShutdownHook, addTask, awaitTermination, confirmShutdown, deadlineNanos, delayNanos, execute, inEventLoop, interruptThread, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isShuttingDown, isTerminated, lazyExecute, newTaskQueue, peekTask, pollTask, pollTaskFrom, reject, reject, removeShutdownHook, removeTask, runAllTasks, runAllTasks, runAllTasksFrom, runScheduledAndExecutorTasks, shutdown, shutdownGracefully, takeTask, terminationFuture, threadProperties, updateLastExecutionTime, wakesUpForTaskcancelScheduledTasks, 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, spliteratorpublic SelectorProvider selectorProvider()
protected Queue<Runnable> newTaskQueue(int maxPendingTasks)
newTaskQueue in class io.netty.util.concurrent.SingleThreadEventExecutorpublic void register(SelectableChannel ch, int interestOps, NioTask<?> task)
SelectableChannel, not necessarily created by Netty, to the Selector
of this event loop. Once the specified SelectableChannel is registered, the specified task will
be executed by this event loop when the SelectableChannel is ready.public int getIoRatio()
public void setIoRatio(int ioRatio)
50, which means the event loop will try to spend the same amount of time for I/O
as for non-I/O tasks. The lower the number the more time can be spent on non-I/O tasks. If value set to
100, this feature will be disabled and event loop will not attempt to balance I/O and non-I/O tasks.public void rebuildSelector()
public int registeredChannels()
SingleThreadEventLoopChannels registered with this EventLoop or -1
if operation is not supported. The returned value is not guaranteed to be exact accurate and
should be viewed as a best effort.registeredChannels in class SingleThreadEventLooppublic Iterator<Channel> registeredChannelsIterator()
registeredChannelsIterator in class SingleThreadEventLoopChannels 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.protected void run()
run in class io.netty.util.concurrent.SingleThreadEventExecutorprotected void cleanup()
cleanup in class io.netty.util.concurrent.SingleThreadEventExecutorprotected void wakeup(boolean inEventLoop)
wakeup in class io.netty.util.concurrent.SingleThreadEventExecutorprotected boolean beforeScheduledTaskSubmitted(long deadlineNanos)
beforeScheduledTaskSubmitted in class io.netty.util.concurrent.AbstractScheduledEventExecutorprotected boolean afterScheduledTaskSubmitted(long deadlineNanos)
afterScheduledTaskSubmitted in class io.netty.util.concurrent.AbstractScheduledEventExecutorCopyright © 2008–2025 The Netty Project. All rights reserved.