Class UnorderedThreadPoolEventExecutor
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ScheduledThreadPoolExecutor
io.netty.util.concurrent.UnorderedThreadPoolEventExecutor
- All Implemented Interfaces:
EventExecutor, EventExecutorGroup, ThreadAwareExecutor, Iterable<EventExecutor>, Executor, ExecutorService, ScheduledExecutorService
@Deprecated
public final class UnorderedThreadPoolEventExecutor
extends ScheduledThreadPoolExecutor
implements EventExecutor
Deprecated.
The behavior of this event executor deviates from the typical Netty execution model
and can cause subtle issues as a result.
Applications that wish to process messages with greater parallelism, should instead do explicit
off-loading to their own thread-pools.
EventExecutor implementation which makes no guarantees about the ordering of task execution that
are submitted because there may be multiple threads executing these tasks.
This implementation is most useful for protocols that do not need strict ordering.
Because it provides no ordering, care should be taken when using it!
-
Nested Class Summary
Nested classes/interfaces inherited from class ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
Constructor Summary
ConstructorsConstructorDescriptionUnorderedThreadPoolEventExecutor(int corePoolSize) Deprecated.UnorderedThreadPoolEventExecutor(int corePoolSize, RejectedExecutionHandler handler) Deprecated.UnorderedThreadPoolEventExecutor(int corePoolSize, ThreadFactory threadFactory) Deprecated.UnorderedThreadPoolEventExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler) -
Method Summary
Modifier and TypeMethodDescriptionprotected <V> RunnableScheduledFuture<V> decorateTask(Runnable runnable, RunnableScheduledFuture<V> task) Deprecated.protected <V> RunnableScheduledFuture<V> decorateTask(Callable<V> callable, RunnableScheduledFuture<V> task) Deprecated.voidDeprecated.booleanDeprecated.CallsEventExecutor.inEventLoop(Thread)withThread.currentThread()as argumentbooleaninEventLoop(Thread thread) Deprecated.booleanDeprecated.Returnstrueif and only if allEventExecutors managed by thisEventExecutorGroupare being shut down gracefully or was shut down.iterator()Deprecated.<V> Future<V> newFailedFuture(Throwable cause) Deprecated.Create a newFuturewhich is marked as failed already.<V> ProgressivePromise<V> Deprecated.Create a newProgressivePromise.<V> Promise<V> Deprecated.Return a newPromise.<V> Future<V> newSucceededFuture(V result) Deprecated.Create a newFuturewhich is marked as succeeded already.next()Deprecated.Returns one of theEventExecutors managed by thisEventExecutorGroup.parent()Deprecated.Return theEventExecutorGroupwhich is the parent of thisEventExecutor,Deprecated.<V> ScheduledFuture<V> Deprecated.scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) Deprecated.scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) Deprecated.voidshutdown()Deprecated.Future<?> Deprecated.Shortcut method forEventExecutorGroup.shutdownGracefully(long, long, TimeUnit)with sensible default values.Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit) Deprecated.Signals this executor that the caller wants the executor to be shut down.Deprecated.Future<?> Deprecated.<T> Future<T> Deprecated.<T> Future<T> Deprecated.Future<?> Deprecated.Returns theFuturewhich is notified when allEventExecutors managed by thisEventExecutorGrouphave been terminated.Methods inherited from class ScheduledThreadPoolExecutor
getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicyMethods inherited from class ThreadPoolExecutor
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, terminated, toStringMethods inherited from class AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskForMethods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface EventExecutor
isExecutorThread, isSuspended, trySuspendMethods inherited from interface EventExecutorGroup
tickerMethods inherited from interface ExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminatedMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
UnorderedThreadPoolEventExecutor
public UnorderedThreadPoolEventExecutor(int corePoolSize) Deprecated. -
UnorderedThreadPoolEventExecutor
Deprecated. -
UnorderedThreadPoolEventExecutor
Deprecated. -
UnorderedThreadPoolEventExecutor
public UnorderedThreadPoolEventExecutor(int corePoolSize, ThreadFactory threadFactory, RejectedExecutionHandler handler) Deprecated.
-
-
Method Details
-
next
Deprecated.Description copied from interface:EventExecutorGroupReturns one of theEventExecutors managed by thisEventExecutorGroup.- Specified by:
nextin interfaceEventExecutorGroup
-
parent
Deprecated.Description copied from interface:EventExecutorReturn theEventExecutorGroupwhich is the parent of thisEventExecutor,- Specified by:
parentin interfaceEventExecutor
-
inEventLoop
public boolean inEventLoop()Deprecated.Description copied from interface:EventExecutorCallsEventExecutor.inEventLoop(Thread)withThread.currentThread()as argument- Specified by:
inEventLoopin interfaceEventExecutor
-
inEventLoop
Deprecated.Description copied from interface:EventExecutor- Specified by:
inEventLoopin interfaceEventExecutor
-
newPromise
Deprecated.Description copied from interface:EventExecutorReturn a newPromise.- Specified by:
newPromisein interfaceEventExecutor
-
newProgressivePromise
Deprecated.Description copied from interface:EventExecutorCreate a newProgressivePromise.- Specified by:
newProgressivePromisein interfaceEventExecutor
-
newSucceededFuture
Deprecated.Description copied from interface:EventExecutorCreate 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.- Specified by:
newSucceededFuturein interfaceEventExecutor
-
newFailedFuture
Deprecated.Description copied from interface:EventExecutorCreate 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.- Specified by:
newFailedFuturein interfaceEventExecutor
-
isShuttingDown
public boolean isShuttingDown()Deprecated.Description copied from interface:EventExecutorGroupReturnstrueif and only if allEventExecutors managed by thisEventExecutorGroupare being shut down gracefully or was shut down.- Specified by:
isShuttingDownin interfaceEventExecutorGroup
-
shutdownNow
Deprecated.- Specified by:
shutdownNowin interfaceEventExecutorGroup- Specified by:
shutdownNowin interfaceExecutorService- Overrides:
shutdownNowin classScheduledThreadPoolExecutor
-
shutdown
public void shutdown()Deprecated.- Specified by:
shutdownin interfaceEventExecutorGroup- Specified by:
shutdownin interfaceExecutorService- Overrides:
shutdownin classScheduledThreadPoolExecutor
-
shutdownGracefully
Deprecated.Description copied from interface:EventExecutorGroupShortcut method forEventExecutorGroup.shutdownGracefully(long, long, TimeUnit)with sensible default values.- Specified by:
shutdownGracefullyin interfaceEventExecutorGroup- Returns:
- the
EventExecutorGroup.terminationFuture()
-
shutdownGracefully
Deprecated.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.- Specified by:
shutdownGracefullyin interfaceEventExecutorGroup- 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
Deprecated.Description copied from interface:EventExecutorGroupReturns theFuturewhich is notified when allEventExecutors managed by thisEventExecutorGrouphave been terminated.- Specified by:
terminationFuturein interfaceEventExecutorGroup
-
iterator
Deprecated.- Specified by:
iteratorin interfaceEventExecutorGroup- Specified by:
iteratorin interfaceIterable<EventExecutor>
-
decorateTask
protected <V> RunnableScheduledFuture<V> decorateTask(Runnable runnable, RunnableScheduledFuture<V> task) Deprecated.- Overrides:
decorateTaskin classScheduledThreadPoolExecutor
-
decorateTask
protected <V> RunnableScheduledFuture<V> decorateTask(Callable<V> callable, RunnableScheduledFuture<V> task) Deprecated.- Overrides:
decorateTaskin classScheduledThreadPoolExecutor
-
schedule
Deprecated.- Specified by:
schedulein interfaceEventExecutorGroup- Specified by:
schedulein interfaceScheduledExecutorService- Overrides:
schedulein classScheduledThreadPoolExecutor
-
schedule
Deprecated.- Specified by:
schedulein interfaceEventExecutorGroup- Specified by:
schedulein interfaceScheduledExecutorService- Overrides:
schedulein classScheduledThreadPoolExecutor
-
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) Deprecated.- Specified by:
scheduleAtFixedRatein interfaceEventExecutorGroup- Specified by:
scheduleAtFixedRatein interfaceScheduledExecutorService- Overrides:
scheduleAtFixedRatein classScheduledThreadPoolExecutor
-
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) Deprecated.- Specified by:
scheduleWithFixedDelayin interfaceEventExecutorGroup- Specified by:
scheduleWithFixedDelayin interfaceScheduledExecutorService- Overrides:
scheduleWithFixedDelayin classScheduledThreadPoolExecutor
-
submit
Deprecated.- Specified by:
submitin interfaceEventExecutorGroup- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classScheduledThreadPoolExecutor
-
submit
Deprecated.- Specified by:
submitin interfaceEventExecutorGroup- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classScheduledThreadPoolExecutor
-
submit
Deprecated.- Specified by:
submitin interfaceEventExecutorGroup- Specified by:
submitin interfaceExecutorService- Overrides:
submitin classScheduledThreadPoolExecutor
-
execute
Deprecated.- Specified by:
executein interfaceExecutor- Overrides:
executein classScheduledThreadPoolExecutor
-