Class DefaultEventLoop
- All Implemented Interfaces:
EventLoop, EventLoopGroup, EventExecutor, EventExecutorGroup, OrderedEventExecutor, ThreadAwareExecutor, Iterable<EventExecutor>, Executor, ExecutorService, ScheduledExecutorService
-
Nested Class Summary
Nested classes/interfaces inherited from class SingleThreadEventLoop
SingleThreadEventLoop.ChannelsReadOnlyIterator<T>Nested classes/interfaces inherited from class SingleThreadEventExecutor
SingleThreadEventExecutor.NonWakeupRunnableNested classes/interfaces inherited from class AbstractEventExecutor
AbstractEventExecutor.LazyRunnable -
Field Summary
Fields inherited from class SingleThreadEventLoop
DEFAULT_MAX_PENDING_TASKS -
Constructor Summary
ConstructorsConstructorDescriptionDefaultEventLoop(EventLoopGroup parent) DefaultEventLoop(EventLoopGroup parent, Executor executor) DefaultEventLoop(EventLoopGroup parent, ThreadFactory threadFactory) DefaultEventLoop(Executor executor) DefaultEventLoop(ThreadFactory threadFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidrun()Runs the task-processing loop untilSingleThreadEventExecutor.confirmShutdown()returnstrue.Methods inherited from class SingleThreadEventLoop
afterRunningAllTasks, executeAfterEventLoopIteration, hasTasks, next, parent, pendingTasks, register, register, register, registeredChannels, registeredChannelsIteratorMethods inherited from class SingleThreadEventExecutor
addShutdownHook, addTask, awaitTermination, canSuspend, canSuspend, cleanup, confirmShutdown, deadlineNanos, delayNanos, execute, getAndIncrementBusyCycles, getAndIncrementIdleCycles, getAndResetAccumulatedActiveTimeNanos, getLastActivityTimeNanos, getNumOfRegisteredChannels, inEventLoop, interruptThread, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isShuttingDown, isSuspended, isSuspensionSupported, isTerminated, lazyExecute, newTaskQueue, newTaskQueue, peekTask, pollTask, pollTaskFrom, reject, reject, removeShutdownHook, removeTask, reportActiveIoTime, resetBusyCycles, resetIdleCycles, runAllTasks, runAllTasks, runAllTasksFrom, runScheduledAndExecutorTasks, shutdown, shutdownGracefully, takeTask, terminationFuture, threadProperties, trySuspend, updateLastExecutionTime, wakesUpForTask, wakeupMethods inherited from class AbstractScheduledEventExecutor
afterScheduledTaskSubmitted, beforeScheduledTaskSubmitted, cancelScheduledTasks, deadlineToDelayNanos, delayNanos, fetchFromScheduledTaskQueue, getCurrentTimeNanos, hasScheduledTasks, initialNanoTime, nanoTime, nextScheduledTaskDeadlineNanos, nextScheduledTaskNano, pollScheduledTask, pollScheduledTask, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, ticker, validateScheduledMethods inherited from class AbstractEventExecutor
iterator, newTaskFor, newTaskFor, runTask, safeExecute, shutdownGracefully, shutdownNow, submit, submit, submitMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EventExecutor
inEventLoop, inEventLoop, isExecutorThread, isSuspended, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, trySuspendMethods inherited from interface EventExecutorGroup
isShuttingDown, iterator, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownGracefully, shutdownGracefully, shutdownNow, submit, submit, submit, terminationFuture, tickerMethods inherited from interface ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminatedMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
DefaultEventLoop
public DefaultEventLoop() -
DefaultEventLoop
-
DefaultEventLoop
-
DefaultEventLoop
-
DefaultEventLoop
-
DefaultEventLoop
-
-
Method Details
-
run
protected void run()Description copied from class:SingleThreadEventExecutorRuns the task-processing loop untilSingleThreadEventExecutor.confirmShutdown()returnstrue.Implementations must not let a
Throwablethrown by a task escape this method: any uncaughtThrowableterminates the executor (logged atWARNand surfaced viaSingleThreadEventExecutor.terminationFuture()), at which point everyChannelregistered with this executor stops processing I/O and new task submissions are rejected. The supplied helpers -SingleThreadEventExecutor.runAllTasks(),SingleThreadEventExecutor.runAllTasks(long), andAbstractEventExecutor.safeExecute(Runnable)- catchThrowablefor you; custom loops built onSingleThreadEventExecutor.pollTask()orSingleThreadEventExecutor.takeTask()are responsible for wrapping each task invocation accordingly.- Specified by:
runin classSingleThreadEventExecutor
-