Class AbstractEventLoop
java.lang.Object
java.util.concurrent.AbstractExecutorService
io.netty.util.concurrent.AbstractEventExecutor
io.netty.channel.AbstractEventLoop
- All Implemented Interfaces:
EventLoop, EventLoopGroup, EventExecutor, EventExecutorGroup, OrderedEventExecutor, ThreadAwareExecutor, Iterable<EventExecutor>, Executor, ExecutorService, ScheduledExecutorService
Skeletal implementation of
EventLoop.-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractEventExecutor
AbstractEventExecutor.LazyRunnable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnext()Returns one of theEventExecutors managed by thisEventExecutorGroup.parent()Return theEventExecutorGroupwhich is the parent of thisEventExecutor,Methods inherited from class AbstractEventExecutor
iterator, lazyExecute, newTaskFor, newTaskFor, runTask, safeExecute, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownGracefully, shutdownNow, submit, submit, submitModifier and TypeMethodDescriptioniterator()voidlazyExecute(Runnable task) LikeExecutor.execute(Runnable)but does not guarantee the task will be run until either a non-lazy task is executed or the executor is shut down.protected final <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) protected final <T> RunnableFuture<T> newTaskFor(Callable<T> callable) protected static voidprotected static voidsafeExecute(Runnable task) <V> ScheduledFuture<V> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) abstract voidshutdown()Future<?> Shortcut method forEventExecutorGroup.shutdownGracefully(long, long, TimeUnit)with sensible default values.Future<?> <T> Future<T> <T> Future<T> Methods 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
inEventLoop, inEventLoop, isExecutorThread, isSuspended, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, trySuspendModifier and TypeMethodDescriptiondefault booleanCallsEventExecutor.inEventLoop(Thread)withThread.currentThread()as argumentbooleaninEventLoop(Thread thread) default booleanisExecutorThread(Thread thread) default booleanReturnstrueif theEventExecutoris considered suspended.default <V> Future<V> newFailedFuture(Throwable cause) Create a newFuturewhich is marked as failed already.default <V> ProgressivePromise<V> Create a newProgressivePromise.default <V> Promise<V> Return a newPromise.default <V> Future<V> newSucceededFuture(V result) Create a newFuturewhich is marked as succeeded already.default booleanTry to suspend thisEventExecutorand returntrueif suspension was successful.Methods inherited from interface EventExecutorGroup
isShuttingDown, shutdownGracefully, terminationFuture, tickerModifier and TypeMethodDescriptionbooleanReturnstrueif and only if allEventExecutors managed by thisEventExecutorGroupare being shut down gracefully or was shut down.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.default Tickerticker()The ticker for this executor.Methods inherited from interface EventLoopGroup
register, register, registerModifier and TypeMethodDescriptionregister(ChannelPromise promise) register(Channel channel, ChannelPromise promise) Deprecated.UseEventLoopGroup.register(ChannelPromise)instead.Methods inherited from interface ExecutorService
awaitTermination, isShutdown, isTerminatedMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
AbstractEventLoop
protected AbstractEventLoop() -
AbstractEventLoop
-
-
Method Details
-
parent
Description copied from interface:EventExecutorReturn theEventExecutorGroupwhich is the parent of thisEventExecutor,- Specified by:
parentin interfaceEventExecutor- Specified by:
parentin interfaceEventLoop- Overrides:
parentin classAbstractEventExecutor
-
next
Description copied from interface:EventExecutorGroupReturns one of theEventExecutors managed by thisEventExecutorGroup.- Specified by:
nextin interfaceEventExecutorGroup- Specified by:
nextin interfaceEventLoopGroup- Overrides:
nextin classAbstractEventExecutor
-
SingleThreadEventExecutor.wakesUpForTask(Runnable)to re-create this behaviour