Package io.netty.util.concurrent
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,java.lang.Iterable<EventExecutor>,java.util.concurrent.Executor,java.util.concurrent.ExecutorService,java.util.concurrent.ScheduledExecutorService
@Deprecated public final class UnorderedThreadPoolEventExecutor extends java.util.concurrent.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.EventExecutorimplementation 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 java.util.concurrent.ThreadPoolExecutor
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy
-
-
Constructor Summary
Constructors Constructor Description UnorderedThreadPoolEventExecutor(int corePoolSize)Deprecated.UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.RejectedExecutionHandler handler)Deprecated.UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.ThreadFactory threadFactory)Deprecated.SeeScheduledThreadPoolExecutor(int, ThreadFactory)UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.RejectedExecutionHandler handler)Deprecated.SeeScheduledThreadPoolExecutor(int, ThreadFactory, RejectedExecutionHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected <V> java.util.concurrent.RunnableScheduledFuture<V>decorateTask(java.lang.Runnable runnable, java.util.concurrent.RunnableScheduledFuture<V> task)Deprecated.protected <V> java.util.concurrent.RunnableScheduledFuture<V>decorateTask(java.util.concurrent.Callable<V> callable, java.util.concurrent.RunnableScheduledFuture<V> task)Deprecated.voidexecute(java.lang.Runnable command)Deprecated.booleaninEventLoop()Deprecated.CallsEventExecutor.inEventLoop(Thread)withThread.currentThread()as argumentbooleaninEventLoop(java.lang.Thread thread)Deprecated.Returntrueif the givenThreadis executed in the event loop,falseotherwise.booleanisShuttingDown()Deprecated.Returnstrueif and only if allEventExecutors managed by thisEventExecutorGroupare being shut down gracefully or was shut down.java.util.Iterator<EventExecutor>iterator()Deprecated.<V> Future<V>newFailedFuture(java.lang.Throwable cause)Deprecated.Create a newFuturewhich is marked as failed already.<V> ProgressivePromise<V>newProgressivePromise()Deprecated.Create a newProgressivePromise.<V> Promise<V>newPromise()Deprecated.Return a newPromise.<V> Future<V>newSucceededFuture(V result)Deprecated.Create a newFuturewhich is marked as succeeded already.EventExecutornext()Deprecated.Returns one of theEventExecutors managed by thisEventExecutorGroup.EventExecutorGroupparent()Deprecated.Return theEventExecutorGroupwhich is the parent of thisEventExecutor,ScheduledFuture<?>schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)Deprecated.<V> ScheduledFuture<V>schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)Deprecated.ScheduledFuture<?>scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)Deprecated.ScheduledFuture<?>scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)Deprecated.voidshutdown()Deprecated.Future<?>shutdownGracefully()Deprecated.Shortcut method forEventExecutorGroup.shutdownGracefully(long, long, TimeUnit)with sensible default values.Future<?>shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)Deprecated.Signals this executor that the caller wants the executor to be shut down.java.util.List<java.lang.Runnable>shutdownNow()Deprecated.Future<?>submit(java.lang.Runnable task)Deprecated.<T> Future<T>submit(java.lang.Runnable task, T result)Deprecated.<T> Future<T>submit(java.util.concurrent.Callable<T> task)Deprecated.Future<?>terminationFuture()Deprecated.Returns theFuturewhich is notified when allEventExecutors managed by thisEventExecutorGrouphave been terminated.-
Methods inherited from class java.util.concurrent.ScheduledThreadPoolExecutor
getContinueExistingPeriodicTasksAfterShutdownPolicy, getExecuteExistingDelayedTasksAfterShutdownPolicy, getQueue, getRemoveOnCancelPolicy, setContinueExistingPeriodicTasksAfterShutdownPolicy, setExecuteExistingDelayedTasksAfterShutdownPolicy, setRemoveOnCancelPolicy
-
Methods inherited from class java.util.concurrent.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, toString
-
Methods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty.util.concurrent.EventExecutor
isExecutorThread, isSuspended, trySuspend
-
Methods inherited from interface io.netty.util.concurrent.EventExecutorGroup
ticker
-
-
-
-
Constructor Detail
-
UnorderedThreadPoolEventExecutor
public UnorderedThreadPoolEventExecutor(int corePoolSize)
Deprecated.
-
UnorderedThreadPoolEventExecutor
public UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.ThreadFactory threadFactory)Deprecated.SeeScheduledThreadPoolExecutor(int, ThreadFactory)
-
UnorderedThreadPoolEventExecutor
public UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.RejectedExecutionHandler handler)Deprecated.
-
UnorderedThreadPoolEventExecutor
public UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.ThreadFactory threadFactory, java.util.concurrent.RejectedExecutionHandler handler)Deprecated.SeeScheduledThreadPoolExecutor(int, ThreadFactory, RejectedExecutionHandler)
-
-
Method Detail
-
next
public EventExecutor next()
Deprecated.Description copied from interface:EventExecutorGroupReturns one of theEventExecutors managed by thisEventExecutorGroup.- Specified by:
nextin interfaceEventExecutorGroup
-
parent
public EventExecutorGroup 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
public boolean inEventLoop(java.lang.Thread thread)
Deprecated.Description copied from interface:EventExecutorReturntrueif the givenThreadis executed in the event loop,falseotherwise.- Specified by:
inEventLoopin interfaceEventExecutor
-
newPromise
public <V> Promise<V> newPromise()
Deprecated.Description copied from interface:EventExecutorReturn a newPromise.- Specified by:
newPromisein interfaceEventExecutor
-
newProgressivePromise
public <V> ProgressivePromise<V> newProgressivePromise()
Deprecated.Description copied from interface:EventExecutorCreate a newProgressivePromise.- Specified by:
newProgressivePromisein interfaceEventExecutor
-
newSucceededFuture
public <V> Future<V> newSucceededFuture(V result)
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
public <V> Future<V> newFailedFuture(java.lang.Throwable cause)
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
public java.util.List<java.lang.Runnable> shutdownNow()
Deprecated.- Specified by:
shutdownNowin interfaceEventExecutorGroup- Specified by:
shutdownNowin interfacejava.util.concurrent.ExecutorService- Overrides:
shutdownNowin classjava.util.concurrent.ScheduledThreadPoolExecutor
-
shutdown
public void shutdown()
Deprecated.- Specified by:
shutdownin interfaceEventExecutorGroup- Specified by:
shutdownin interfacejava.util.concurrent.ExecutorService- Overrides:
shutdownin classjava.util.concurrent.ScheduledThreadPoolExecutor
-
shutdownGracefully
public Future<?> 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
public Future<?> shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
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
public Future<?> terminationFuture()
Deprecated.Description copied from interface:EventExecutorGroupReturns theFuturewhich is notified when allEventExecutors managed by thisEventExecutorGrouphave been terminated.- Specified by:
terminationFuturein interfaceEventExecutorGroup
-
iterator
public java.util.Iterator<EventExecutor> iterator()
Deprecated.- Specified by:
iteratorin interfaceEventExecutorGroup- Specified by:
iteratorin interfacejava.lang.Iterable<EventExecutor>
-
decorateTask
protected <V> java.util.concurrent.RunnableScheduledFuture<V> decorateTask(java.lang.Runnable runnable, java.util.concurrent.RunnableScheduledFuture<V> task)Deprecated.- Overrides:
decorateTaskin classjava.util.concurrent.ScheduledThreadPoolExecutor
-
decorateTask
protected <V> java.util.concurrent.RunnableScheduledFuture<V> decorateTask(java.util.concurrent.Callable<V> callable, java.util.concurrent.RunnableScheduledFuture<V> task)Deprecated.- Overrides:
decorateTaskin classjava.util.concurrent.ScheduledThreadPoolExecutor
-
schedule
public ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
Deprecated.- Specified by:
schedulein interfaceEventExecutorGroup- Specified by:
schedulein interfacejava.util.concurrent.ScheduledExecutorService- Overrides:
schedulein classjava.util.concurrent.ScheduledThreadPoolExecutor
-
schedule
public <V> ScheduledFuture<V> schedule(java.util.concurrent.Callable<V> callable, long delay, java.util.concurrent.TimeUnit unit)
Deprecated.- Specified by:
schedulein interfaceEventExecutorGroup- Specified by:
schedulein interfacejava.util.concurrent.ScheduledExecutorService- Overrides:
schedulein classjava.util.concurrent.ScheduledThreadPoolExecutor
-
scheduleAtFixedRate
public ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
Deprecated.- Specified by:
scheduleAtFixedRatein interfaceEventExecutorGroup- Specified by:
scheduleAtFixedRatein interfacejava.util.concurrent.ScheduledExecutorService- Overrides:
scheduleAtFixedRatein classjava.util.concurrent.ScheduledThreadPoolExecutor
-
scheduleWithFixedDelay
public ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
Deprecated.- Specified by:
scheduleWithFixedDelayin interfaceEventExecutorGroup- Specified by:
scheduleWithFixedDelayin interfacejava.util.concurrent.ScheduledExecutorService- Overrides:
scheduleWithFixedDelayin classjava.util.concurrent.ScheduledThreadPoolExecutor
-
submit
public Future<?> submit(java.lang.Runnable task)
Deprecated.- Specified by:
submitin interfaceEventExecutorGroup- Specified by:
submitin interfacejava.util.concurrent.ExecutorService- Overrides:
submitin classjava.util.concurrent.ScheduledThreadPoolExecutor
-
submit
public <T> Future<T> submit(java.lang.Runnable task, T result)
Deprecated.- Specified by:
submitin interfaceEventExecutorGroup- Specified by:
submitin interfacejava.util.concurrent.ExecutorService- Overrides:
submitin classjava.util.concurrent.ScheduledThreadPoolExecutor
-
submit
public <T> Future<T> submit(java.util.concurrent.Callable<T> task)
Deprecated.- Specified by:
submitin interfaceEventExecutorGroup- Specified by:
submitin interfacejava.util.concurrent.ExecutorService- Overrides:
submitin classjava.util.concurrent.ScheduledThreadPoolExecutor
-
execute
public void execute(java.lang.Runnable command)
Deprecated.- Specified by:
executein interfacejava.util.concurrent.Executor- Overrides:
executein classjava.util.concurrent.ScheduledThreadPoolExecutor
-
-