public interface EventExecutor extends EventExecutorGroup
EventExecutor is a special EventExecutorGroup which comes
with some handy methods to see if a Thread is executed in a event loop.
Besides this, it also extends the EventExecutorGroup to allow for a generic
way to access methods.| Modifier and Type | Method and Description |
|---|---|
default boolean |
inEventLoop()
Calls
inEventLoop(Thread) with Thread.currentThread() as argument |
boolean |
inEventLoop(Thread thread)
|
default boolean |
isSuspended()
Returns
true if the EventExecutor is considered suspended. |
default <V> Future<V> |
newFailedFuture(Throwable cause)
Create a new
Future which is marked as failed already. |
default <V> ProgressivePromise<V> |
newProgressivePromise()
Create a new
ProgressivePromise. |
default <V> Promise<V> |
newPromise()
Return a new
Promise. |
default <V> Future<V> |
newSucceededFuture(V result)
Create a new
Future which is marked as succeeded already. |
EventExecutorGroup |
parent()
Return the
EventExecutorGroup which is the parent of this EventExecutor, |
default boolean |
trySuspend()
Try to suspend this
EventExecutor and return true if suspension was successful. |
isShuttingDown, iterator, next, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownGracefully, shutdownGracefully, shutdownNow, submit, submit, submit, terminationFutureawaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminatedforEach, spliteratorEventExecutorGroup parent()
EventExecutorGroup which is the parent of this EventExecutor,default boolean inEventLoop()
inEventLoop(Thread) with Thread.currentThread() as argumentboolean inEventLoop(Thread thread)
default <V> ProgressivePromise<V> newProgressivePromise()
ProgressivePromise.default <V> Future<V> newSucceededFuture(V result)
Future which is marked as succeeded already. So Future.isSuccess()
will return true. All FutureListener added to it will be notified directly. Also
every call of blocking methods will just return without blocking.default <V> Future<V> newFailedFuture(Throwable cause)
Future which is marked as failed already. So Future.isSuccess()
will return false. All FutureListener added to it will be notified directly. Also
every call of blocking methods will just return without blocking.default boolean isSuspended()
true if the EventExecutor is considered suspended.true if suspended, false otherwise.default boolean trySuspend()
EventExecutor and return true if suspension was successful.
Suspending an EventExecutor will allow it to free up resources, like for example a Thread that
is backing the EventExecutor. Once an EventExecutor was suspended it will be started again
by submitting work to it via one of the following methods:
Executor.execute(Runnable)EventExecutorGroup.schedule(Runnable, long, TimeUnit)EventExecutorGroup.schedule(Callable, long, TimeUnit)EventExecutorGroup.scheduleAtFixedRate(Runnable, long, long, TimeUnit)EventExecutorGroup.scheduleWithFixedDelay(Runnable, long, long, TimeUnit)true it might take some time for the EventExecutor to fully suspend
itself.true if suspension was successful, otherwise false.Copyright © 2008–2024 The Netty Project. All rights reserved.