Package io.netty.util.concurrent
Interface EventExecutor
-
- All Superinterfaces:
EventExecutorGroup,java.util.concurrent.Executor,java.util.concurrent.ExecutorService,java.lang.Iterable<EventExecutor>,java.util.concurrent.ScheduledExecutorService
- All Known Subinterfaces:
EventLoop,OrderedEventExecutor
- All Known Implementing Classes:
AbstractEventExecutor,AbstractEventLoop,AbstractScheduledEventExecutor,DefaultEventExecutor,DefaultEventLoop,EmbeddedEventLoop,GlobalEventExecutor,ImmediateEventExecutor,NioEventLoop,NonStickyEventExecutorGroup.NonStickyOrderedEventExecutor,SingleThreadEventExecutor,SingleThreadEventLoop,ThreadPerChannelEventLoop,UnorderedThreadPoolEventExecutor
public interface EventExecutor extends EventExecutorGroup
TheEventExecutoris a specialEventExecutorGroupwhich comes with some handy methods to see if aThreadis executed in a event loop. Besides this, it also extends theEventExecutorGroupto allow for a generic way to access methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleaninEventLoop()CallsinEventLoop(Thread)withThread.currentThread()as argumentbooleaninEventLoop(java.lang.Thread thread)Returntrueif the givenThreadis executed in the event loop,falseotherwise.<V> Future<V>newFailedFuture(java.lang.Throwable cause)Create a newFuturewhich is marked as failed already.<V> ProgressivePromise<V>newProgressivePromise()Create a newProgressivePromise.<V> Promise<V>newPromise()Return a newPromise.<V> Future<V>newSucceededFuture(V result)Create a newFuturewhich is marked as succeeded already.EventExecutornext()Returns a reference to itself.EventExecutorGroupparent()Return theEventExecutorGroupwhich is the parent of thisEventExecutor,-
Methods inherited from interface io.netty.util.concurrent.EventExecutorGroup
isShuttingDown, iterator, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdown, shutdownGracefully, shutdownGracefully, shutdownNow, submit, submit, submit, terminationFuture
-
-
-
-
Method Detail
-
next
EventExecutor next()
Returns a reference to itself.- Specified by:
nextin interfaceEventExecutorGroup
-
parent
EventExecutorGroup parent()
Return theEventExecutorGroupwhich is the parent of thisEventExecutor,
-
inEventLoop
boolean inEventLoop()
CallsinEventLoop(Thread)withThread.currentThread()as argument
-
inEventLoop
boolean inEventLoop(java.lang.Thread thread)
Returntrueif the givenThreadis executed in the event loop,falseotherwise.
-
newProgressivePromise
<V> ProgressivePromise<V> newProgressivePromise()
Create a newProgressivePromise.
-
newSucceededFuture
<V> Future<V> newSucceededFuture(V result)
Create a newFuturewhich is marked as succeeded already. SoFuture.isSuccess()will returntrue. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.
-
newFailedFuture
<V> Future<V> newFailedFuture(java.lang.Throwable cause)
Create a newFuturewhich is marked as failed already. SoFuture.isSuccess()will returnfalse. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.
-
-