SingleThreadEventLoop implementation which register the Channel's to a
Selector and so does the multi-plexing of these in the event loop.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final long | |
| private int | |
| private static final int | |
| private static final boolean | |
| private volatile int | |
| private static final InternalLogger | |
| private static final int | |
| private boolean | |
| private final AtomicLong | |
| private static final long | |
| private final SelectorProvider | |
| private SelectedSelectionKeySet | |
| private final IntSupplier | |
| private Selector | |
| private static final int | |
| private final SelectStrategy | |
| private Selector |
| Access | Constructor and Description |
|---|---|
| pack-priv | NioEventLoop(NioEventLoopGroup parent, Executor executor, SelectorProvider selectorProvider, SelectStrategy strategy, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory, EventLoopTaskQueueFactory tailTaskQueueFactory)
|
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | afterScheduledTaskSubmitted(long deadlineNanos)
Overrides io. beforeScheduledTaskSubmitted(long).
|
| protected boolean | beforeScheduledTaskSubmitted(long
deadline of the to-be-scheduled task
relative to deadlineNanos)AbstractScheduledEventExecutor#getCurrentTimeNanos()Overrides io. EventExecutor threads prior to scheduled task submission.
|
| pack-priv void | |
| protected void | cleanup()
Overrides io. |
| private void | |
| public int | |
| private static void | |
| private static void | |
| private static Queue | |
| protected Queue | newTaskQueue(int maxPendingTasks)
Overrides io. Queue which will holds the tasks to execute.
|
| private static Queue | |
| private NioEventLoop. | |
| private void | |
| private static void | |
| private void | |
| private void | |
| private void | |
| public void | rebuildSelector()
Replaces the current |
| private void | |
| public void | register(final SelectableChannel ch, final int interestOps, final NioTask<?> task)
Registers an arbitrary |
| private void | |
| public int | registeredChannels()
Overrides io. Channels registered with this EventLoop or -1
if operation is not supported.
|
| public Iterator | |
| protected void | run()
Implements abstract io. taskQueue
|
| private int | |
| private void | |
| pack-priv int | |
| public SelectorProvider | |
| public void | setIoRatio(int ioRatio)
Sets the percentage of the desired amount of time spent for I/O in the event loop. |
| private boolean | |
| pack-priv Selector | |
| protected void |
| AWAKE | back to summary |
|---|---|
| private static final long AWAKE | |
| cancelledKeys | back to summary |
|---|---|
| private int cancelledKeys | |
| CLEANUP_INTERVAL | back to summary |
|---|---|
| private static final int CLEANUP_INTERVAL | |
| DISABLE_KEY_SET_OPTIMIZATION | back to summary |
|---|---|
| private static final boolean DISABLE_KEY_SET_OPTIMIZATION | |
| ioRatio | back to summary |
|---|---|
| private volatile int ioRatio | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger Hides io. | |
| MIN_PREMATURE_SELECTOR_RETURNS | back to summary |
|---|---|
| private static final int MIN_PREMATURE_SELECTOR_RETURNS | |
| needsToSelectAgain | back to summary |
|---|---|
| private boolean needsToSelectAgain | |
| nextWakeupNanos | back to summary |
|---|---|
| private final AtomicLong nextWakeupNanos | |
| NONE | back to summary |
|---|---|
| private static final long NONE | |
| provider | back to summary |
|---|---|
| private final SelectorProvider provider | |
| selectedKeys | back to summary |
|---|---|
| private SelectedSelectionKeySet selectedKeys | |
| selectNowSupplier | back to summary |
|---|---|
| private final IntSupplier selectNowSupplier | |
| selector | back to summary |
|---|---|
| private Selector selector The NIO | |
| SELECTOR_AUTO_REBUILD_THRESHOLD | back to summary |
|---|---|
| private static final int SELECTOR_AUTO_REBUILD_THRESHOLD | |
| selectStrategy | back to summary |
|---|---|
| private final SelectStrategy selectStrategy | |
| unwrappedSelector | back to summary |
|---|---|
| private Selector unwrappedSelector | |
| NioEventLoop | back to summary |
|---|---|
| pack-priv NioEventLoop(NioEventLoopGroup parent, Executor executor, SelectorProvider selectorProvider, SelectStrategy strategy, RejectedExecutionHandler rejectedExecutionHandler, EventLoopTaskQueueFactory taskQueueFactory, EventLoopTaskQueueFactory tailTaskQueueFactory) | |
| afterScheduledTaskSubmitted | back to summary |
|---|---|
| protected boolean afterScheduledTaskSubmitted(long deadlineNanos) Overrides io. Doc from io. See
| |
| beforeScheduledTaskSubmitted | back to summary |
|---|---|
| protected boolean beforeScheduledTaskSubmitted(long deadlineNanos) Overrides io. Doc from io. Called from arbitrary non-
If
| |
| cancel | back to summary |
|---|---|
| pack-priv void cancel(SelectionKey key) | |
| cleanup | back to summary |
|---|---|
| protected void cleanup() Overrides io. Doc from io. Do nothing, sub-classes may override
| |
| closeAll | back to summary |
|---|---|
| private void closeAll() | |
| getIoRatio | back to summary |
|---|---|
| public int getIoRatio() Returns the percentage of the desired amount of time spent for I/O in the event loop. | |
| handleLoopException | back to summary |
|---|---|
| private static void handleLoopException(Throwable t) | |
| invokeChannelUnregistered | back to summary |
|---|---|
| private static void invokeChannelUnregistered(NioTask<SelectableChannel> task, SelectionKey k, Throwable cause) | |
| newTaskQueue | back to summary |
|---|---|
| private static Queue | |
| newTaskQueue | back to summary |
|---|---|
| protected Queue Overrides io. Doc from io. Create a new
| |
| newTaskQueue0 | back to summary |
|---|---|
| private static Queue | |
| openSelector | back to summary |
|---|---|
| private NioEventLoop. | |
| processSelectedKey | back to summary |
|---|---|
| private void processSelectedKey(SelectionKey k, AbstractNioChannel ch) | |
| processSelectedKey | back to summary |
|---|---|
| private static void processSelectedKey(SelectionKey k, NioTask<SelectableChannel> task) | |
| processSelectedKeys | back to summary |
|---|---|
| private void processSelectedKeys() | |
| processSelectedKeysOptimized | back to summary |
|---|---|
| private void processSelectedKeysOptimized() | |
| processSelectedKeysPlain | back to summary |
|---|---|
| private void processSelectedKeysPlain(Set<SelectionKey> selectedKeys) | |
| rebuildSelector | back to summary |
|---|---|
| public void rebuildSelector() Replaces the current | |
| rebuildSelector0 | back to summary |
|---|---|
| private void rebuildSelector0() | |
| register | back to summary |
|---|---|
| public void register(final SelectableChannel ch, final int interestOps, final NioTask<?> task) Registers an arbitrary | |
| register0 | back to summary |
|---|---|
| private void register0(SelectableChannel ch, int interestOps, NioTask<?> task) | |
| registeredChannels | back to summary |
|---|---|
| public int registeredChannels() Overrides io. Doc from io. Returns the number of
| |
| registeredChannelsIterator | back to summary |
|---|---|
| public Iterator Overrides io.
| |
| run | back to summary |
|---|---|
| protected void run() Implements abstract io. Doc from io. Run the tasks in the
| |
| select | back to summary |
|---|---|
| private int select(long deadlineNanos) throws IOException | |
| selectAgain | back to summary |
|---|---|
| private void selectAgain() | |
| selectNow | back to summary |
|---|---|
| pack-priv int selectNow() throws IOException | |
| selectorProvider | back to summary |
|---|---|
| public SelectorProvider selectorProvider() Returns the | |
| setIoRatio | back to summary |
|---|---|
| public void setIoRatio(int ioRatio) Sets the percentage of the desired amount of time spent for I/O in the event loop. Value range from 1-100.
The default value is | |
| unexpectedSelectorWakeup | back to summary |
|---|---|
| private boolean unexpectedSelectorWakeup(int selectCnt) | |
| unwrappedSelector | back to summary |
|---|---|
| pack-priv Selector unwrappedSelector() | |
| wakeup | back to summary |
|---|---|
| protected void wakeup(boolean inEventLoop) Overrides io.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Selector | |
| pack-priv final Selector |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| selector | back to summary |
|---|---|
| pack-priv final Selector selector | |
| unwrappedSelector | back to summary |
|---|---|
| pack-priv final Selector unwrappedSelector | |
| SelectorTuple | back to summary |
|---|---|
| pack-priv SelectorTuple(Selector unwrappedSelector) | |
| SelectorTuple | back to summary |
|---|---|
| pack-priv SelectorTuple(Selector unwrappedSelector, Selector selector) | |