EventLoop that execute all its submitted tasks in a single thread and uses an IoHandler for
IO processing.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static interface | SingleThreadEventLoop.NonWakeupRunnable
Marker interface for |
| Modifier and Type | Field and Description |
|---|---|
| private final IoExecutionContext | |
| protected static final int | |
| protected static final int | |
| private final IoHandler | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | SingleThreadEventLoop(ThreadFactory
the threadFactory, IoHandler ThreadFactory which will be used for the used Threadthe ioHandler)IoHandler to use.Create a new instance |
| public | |
| public | SingleThreadEventLoop(ThreadFactory
the threadFactory, IoHandler ThreadFactory which will be used for the used Threadthe ioHandler, int IoHandler to use.the maximum number of pending tasks before new tasks will be rejected. maxPendingTasks, RejectedExecutionHandler the rejectedHandler)RejectedExecutionHandler to use.Create a new instance |
| public | SingleThreadEventLoop(Executor executor, IoHandler
the ioHandler, int IoHandler to use.the maximum number of pending tasks before new tasks will be rejected. maxPendingTasks, RejectedExecutionHandler the rejectedHandler)RejectedExecutionHandler to use.Create a new instance |
| public | SingleThreadEventLoop(ThreadFactory
the threadFactory, IoHandler ThreadFactory which will be used for the used Threadthe ioHandler, int IoHandler to use.the maximum number of pending tasks before new tasks will be rejected. maxPendingTasks, RejectedExecutionHandler the rejectedHandler, int RejectedExecutionHandler to use.the maximum number of tasks per maxTasksPerRun)EventLoop run that will be processed
before trying to handle IO again.Create a new instance |
| public | SingleThreadEventLoop(Executor executor, IoHandler
the ioHandler, int IoHandler to use.the maximum number of pending tasks before new tasks will be rejected. maxPendingTasks, RejectedExecutionHandler the rejectedHandler, int RejectedExecutionHandler to use.the maximum number of tasks per maxTasksPerRun)EventLoop run that will be processed
before trying to handle IO again.Create a new instance |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| protected final void | cleanup()
Overrides io. |
| public final Future | deregisterForIo(IoHandle
the handle)IoHandle to deregister.Implements io. Channel from the EventLoop for I/O processing.
|
| private void | |
| public boolean | isCompatible(Class<? extends IoHandle>
the type of the handleType)IoHandle.Implements io. true if the given type is compatible with this EventLoopGroup and so can be registered
to the contained EventLoops, false otherwise.
|
| protected Queue | newTaskQueue(int maxPendingTasks)
Overrides io. Queue which will holds the tasks to execute.
|
| public final Future | registerForIo(IoHandle
the handle)IoHandle to register.Implements io. IoHandle to the EventLoop for I/O processing.
|
| private void | |
| protected void | run()
Overrides io. SingleThreadEventExecutor.
|
| protected int | |
| protected final boolean | wakesUpForTask(Runnable task)
Overrides io. true if wakeup(boolean) should be called for this Runnable, false
otherwise.
|
| protected final void |
| context | back to summary |
|---|---|
| private final IoExecutionContext context | |
| DEFAULT_MAX_PENDING_TASKS | back to summary |
|---|---|
| protected static final int DEFAULT_MAX_PENDING_TASKS | |
| DEFAULT_MAX_TASKS_PER_RUN | back to summary |
|---|---|
| protected static final int DEFAULT_MAX_TASKS_PER_RUN | |
| ioHandler | back to summary |
|---|---|
| private final IoHandler ioHandler | |
| maxTasksPerRun | back to summary |
|---|---|
| private final int maxTasksPerRun | |
| SingleThreadEventLoop | back to summary |
|---|---|
| public SingleThreadEventLoop(ThreadFactory threadFactory, IoHandler ioHandler) Create a new instance
| |
| SingleThreadEventLoop | back to summary |
|---|---|
| public SingleThreadEventLoop(Executor executor, IoHandler ioHandler) Create a new instance | |
| SingleThreadEventLoop | back to summary |
|---|---|
| public SingleThreadEventLoop(ThreadFactory threadFactory, IoHandler ioHandler, int maxPendingTasks, RejectedExecutionHandler rejectedHandler) Create a new instance
| |
| SingleThreadEventLoop | back to summary |
|---|---|
| public SingleThreadEventLoop(Executor executor, IoHandler ioHandler, int maxPendingTasks, RejectedExecutionHandler rejectedHandler) Create a new instance
| |
| SingleThreadEventLoop | back to summary |
|---|---|
| public SingleThreadEventLoop(ThreadFactory threadFactory, IoHandler ioHandler, int maxPendingTasks, RejectedExecutionHandler rejectedHandler, int maxTasksPerRun) Create a new instance
| |
| SingleThreadEventLoop | back to summary |
|---|---|
| public SingleThreadEventLoop(Executor executor, IoHandler ioHandler, int maxPendingTasks, RejectedExecutionHandler rejectedHandler, int maxTasksPerRun) Create a new instance
| |
| checkInEventLoopIfPossible | back to summary |
|---|---|
| private static void checkInEventLoopIfPossible(IoHandle handle) | |
| cleanup | back to summary |
|---|---|
| protected final void cleanup() Overrides io. Doc from io. Do nothing, sub-classes may override.
| |
| deregisterForIo | back to summary |
|---|---|
| public final Future Implements io. Doc from io. Deregister the | |
| deregisterForIO | back to summary |
|---|---|
| private void deregisterForIO(IoHandle handle, Promise<Void> promise) | |
| isCompatible | back to summary |
|---|---|
| public boolean isCompatible(Class<? extends IoHandle> handleType) Implements io. Doc from io. Returns | |
| newTaskQueue | back to summary |
|---|---|
| protected Queue Overrides io. Doc from io. Create a new
| |
| registerForIo | back to summary |
|---|---|
| public final Future Implements io. | |
| registerForIO0 | back to summary |
|---|---|
| private void registerForIO0(IoHandle handle, Promise<Void> promise) | |
| run | back to summary |
|---|---|
| protected void run() Overrides io. Doc from io. Run tasks that are submitted to this
| |
| runIO | back to summary |
|---|---|
| protected int runIO() Called when IO will be processed for all the | |
| wakesUpForTask | back to summary |
|---|---|
| protected final boolean wakesUpForTask(Runnable task) Overrides io. Doc from io. Returns
| |
| wakeup | back to summary |
|---|---|
| protected final void wakeup(boolean inEventLoop) Overrides io.
| |
Runnable that will not trigger an wakeup(boolean) in all cases.