Class ImmediateEventExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
io.netty.util.concurrent.AbstractEventExecutor
io.netty.util.concurrent.ImmediateEventExecutor
- All Implemented Interfaces:
EventExecutor, EventExecutorGroup, ThreadAwareExecutor, Iterable<EventExecutor>, Executor, ExecutorService, ScheduledExecutorService
Executes
Runnable objects in the caller's thread. If the execute(Runnable) is reentrant it will be
queued until the original Runnable finishes execution.
All Throwable objects thrown from execute(Runnable) will be swallowed and logged. This is to ensure
that all queued Runnable objects have the chance to be run.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractEventExecutor
AbstractEventExecutor.LazyRunnable -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long timeout, TimeUnit unit) voidbooleanCallsEventExecutor.inEventLoop(Thread)withThread.currentThread()as argumentbooleaninEventLoop(Thread thread) booleanbooleanReturnstrueif and only if allEventExecutors managed by thisEventExecutorGroupare being shut down gracefully or was shut down.boolean<V> ProgressivePromise<V> Create a newProgressivePromise.<V> Promise<V> Return a newPromise.voidshutdown()Deprecated.Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit) Signals this executor that the caller wants the executor to be shut down.Future<?> Returns theFuturewhich is notified when allEventExecutors managed by thisEventExecutorGrouphave been terminated.Methods inherited from class AbstractEventExecutor
iterator, lazyExecute, newTaskFor, newTaskFor, next, parent, runTask, safeExecute, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submitMethods inherited from class AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAnyMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EventExecutor
isExecutorThread, isSuspended, newFailedFuture, newSucceededFuture, trySuspendMethods inherited from interface EventExecutorGroup
tickerMethods inherited from interface ExecutorService
invokeAll, invokeAll, invokeAny, invokeAnyMethods inherited from interface Iterable
forEach, spliterator
-
Field Details
-
INSTANCE
-
-
Method Details
-
inEventLoop
public boolean inEventLoop()Description copied from interface:EventExecutorCallsEventExecutor.inEventLoop(Thread)withThread.currentThread()as argument -
inEventLoop
Description copied from interface:EventExecutor -
shutdownGracefully
Description copied from interface:EventExecutorGroupSignals this executor that the caller wants the executor to be shut down. Once this method is called,EventExecutorGroup.isShuttingDown()starts to returntrue, and the executor prepares to shut itself down. UnlikeEventExecutorGroup.shutdown(), graceful shutdown ensures that no tasks are submitted for 'the quiet period' (usually a couple seconds) before it shuts itself down. If a task is submitted during the quiet period, it is guaranteed to be accepted and the quiet period will start over.- Parameters:
quietPeriod- the quiet period as described in the documentationtimeout- the maximum amount of time to wait until the executor is EventExecutorGroup.shutdown() regardless if a task was submitted during the quiet periodunit- the unit ofquietPeriodandtimeout- Returns:
- the
EventExecutorGroup.terminationFuture()
-
terminationFuture
Description copied from interface:EventExecutorGroupReturns theFuturewhich is notified when allEventExecutors managed by thisEventExecutorGrouphave been terminated. -
shutdown
Deprecated.- Specified by:
shutdownin interfaceEventExecutorGroup- Specified by:
shutdownin interfaceExecutorService- Specified by:
shutdownin classAbstractEventExecutor
-
isShuttingDown
public boolean isShuttingDown()Description copied from interface:EventExecutorGroupReturnstrueif and only if allEventExecutors managed by thisEventExecutorGroupare being shut down gracefully or was shut down. -
isShutdown
public boolean isShutdown() -
isTerminated
public boolean isTerminated() -
awaitTermination
-
execute
-
newPromise
Description copied from interface:EventExecutorReturn a newPromise. -
newProgressivePromise
Description copied from interface:EventExecutorCreate a newProgressivePromise.
-