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.
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!

  • Field Details

    • logger

      private static final InternalLogger logger
      Deprecated.
    • terminationFuture

      private final Promise<?> terminationFuture
      Deprecated.
    • executorSet

      private final java.util.Set<EventExecutor> executorSet
      Deprecated.
    • eventLoopThreads

      private final java.util.Set<java.lang.Thread> eventLoopThreads
      Deprecated.
  • Constructor Details

    • UnorderedThreadPoolEventExecutor

      public UnorderedThreadPoolEventExecutor(int corePoolSize)
      Deprecated.
    • UnorderedThreadPoolEventExecutor

      public UnorderedThreadPoolEventExecutor(int corePoolSize, java.util.concurrent.ThreadFactory threadFactory)
      Deprecated.
      See ScheduledThreadPoolExecutor(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.
      See ScheduledThreadPoolExecutor(int, ThreadFactory, RejectedExecutionHandler)
  • Method Details

    • next

      public EventExecutor next()
      Deprecated.
      Description copied from interface: EventExecutorGroup
      Returns one of the EventExecutors managed by this EventExecutorGroup.
      Specified by:
      next in interface EventExecutorGroup
    • parent

      public EventExecutorGroup parent()
      Deprecated.
      Description copied from interface: EventExecutor
      Return the EventExecutorGroup which is the parent of this EventExecutor,
      Specified by:
      parent in interface EventExecutor
    • inEventLoop

      public boolean inEventLoop()
      Deprecated.
      Description copied from interface: EventExecutor
      Calls EventExecutor.inEventLoop(Thread) with Thread.currentThread() as argument
      Specified by:
      inEventLoop in interface EventExecutor
    • inEventLoop

      public boolean inEventLoop(java.lang.Thread thread)
      Deprecated.
      Description copied from interface: EventExecutor
      Return true if the given Thread is executed in the event loop, false otherwise.
      Specified by:
      inEventLoop in interface EventExecutor
    • newPromise

      public <V> Promise<V> newPromise()
      Deprecated.
      Description copied from interface: EventExecutor
      Return a new Promise.
      Specified by:
      newPromise in interface EventExecutor
    • newProgressivePromise

      public <V> ProgressivePromise<V> newProgressivePromise()
      Deprecated.
      Description copied from interface: EventExecutor
      Create a new ProgressivePromise.
      Specified by:
      newProgressivePromise in interface EventExecutor
    • newSucceededFuture

      public <V> Future<V> newSucceededFuture(V result)
      Deprecated.
      Description copied from interface: EventExecutor
      Create a new 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.
      Specified by:
      newSucceededFuture in interface EventExecutor
    • newFailedFuture

      public <V> Future<V> newFailedFuture(java.lang.Throwable cause)
      Deprecated.
      Description copied from interface: EventExecutor
      Create a new 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.
      Specified by:
      newFailedFuture in interface EventExecutor
    • isShuttingDown

      public boolean isShuttingDown()
      Deprecated.
      Description copied from interface: EventExecutorGroup
      Returns true if and only if all EventExecutors managed by this EventExecutorGroup are being shut down gracefully or was shut down.
      Specified by:
      isShuttingDown in interface EventExecutorGroup
    • shutdownNow

      public java.util.List<java.lang.Runnable> shutdownNow()
      Deprecated.
      Specified by:
      shutdownNow in interface EventExecutorGroup
      Specified by:
      shutdownNow in interface java.util.concurrent.ExecutorService
      Overrides:
      shutdownNow in class java.util.concurrent.ScheduledThreadPoolExecutor
    • shutdown

      public void shutdown()
      Deprecated.
      Specified by:
      shutdown in interface EventExecutorGroup
      Specified by:
      shutdown in interface java.util.concurrent.ExecutorService
      Overrides:
      shutdown in class java.util.concurrent.ScheduledThreadPoolExecutor
    • shutdownGracefully

      public Future<?> shutdownGracefully()
      Deprecated.
      Description copied from interface: EventExecutorGroup
      Shortcut method for EventExecutorGroup.shutdownGracefully(long, long, TimeUnit) with sensible default values.
      Specified by:
      shutdownGracefully in interface EventExecutorGroup
      Returns:
      the EventExecutorGroup.terminationFuture()
    • shutdownGracefully

      public Future<?> shutdownGracefully(long quietPeriod, long timeout, java.util.concurrent.TimeUnit unit)
      Deprecated.
      Description copied from interface: EventExecutorGroup
      Signals this executor that the caller wants the executor to be shut down. Once this method is called, EventExecutorGroup.isShuttingDown() starts to return true, and the executor prepares to shut itself down. Unlike EventExecutorGroup.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:
      shutdownGracefully in interface EventExecutorGroup
      Parameters:
      quietPeriod - the quiet period as described in the documentation
      timeout - the maximum amount of time to wait until the executor is EventExecutorGroup.shutdown() regardless if a task was submitted during the quiet period
      unit - the unit of quietPeriod and timeout
      Returns:
      the EventExecutorGroup.terminationFuture()
    • terminationFuture

      public Future<?> terminationFuture()
      Deprecated.
      Description copied from interface: EventExecutorGroup
      Returns the Future which is notified when all EventExecutors managed by this EventExecutorGroup have been terminated.
      Specified by:
      terminationFuture in interface EventExecutorGroup
    • iterator

      public java.util.Iterator<EventExecutor> iterator()
      Deprecated.
      Specified by:
      iterator in interface EventExecutorGroup
      Specified by:
      iterator in interface java.lang.Iterable<EventExecutor>
    • decorateTask

      protected <V> java.util.concurrent.RunnableScheduledFuture<V> decorateTask(java.lang.Runnable runnable, java.util.concurrent.RunnableScheduledFuture<V> task)
      Deprecated.
      Overrides:
      decorateTask in class java.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:
      decorateTask in class java.util.concurrent.ScheduledThreadPoolExecutor
    • schedule

      public ScheduledFuture<?> schedule(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
      Deprecated.
      Specified by:
      schedule in interface EventExecutorGroup
      Specified by:
      schedule in interface java.util.concurrent.ScheduledExecutorService
      Overrides:
      schedule in class java.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:
      schedule in interface EventExecutorGroup
      Specified by:
      schedule in interface java.util.concurrent.ScheduledExecutorService
      Overrides:
      schedule in class java.util.concurrent.ScheduledThreadPoolExecutor
    • scheduleAtFixedRate

      public ScheduledFuture<?> scheduleAtFixedRate(java.lang.Runnable command, long initialDelay, long period, java.util.concurrent.TimeUnit unit)
      Deprecated.
      Specified by:
      scheduleAtFixedRate in interface EventExecutorGroup
      Specified by:
      scheduleAtFixedRate in interface java.util.concurrent.ScheduledExecutorService
      Overrides:
      scheduleAtFixedRate in class java.util.concurrent.ScheduledThreadPoolExecutor
    • scheduleWithFixedDelay

      public ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
      Deprecated.
      Specified by:
      scheduleWithFixedDelay in interface EventExecutorGroup
      Specified by:
      scheduleWithFixedDelay in interface java.util.concurrent.ScheduledExecutorService
      Overrides:
      scheduleWithFixedDelay in class java.util.concurrent.ScheduledThreadPoolExecutor
    • submit

      public Future<?> submit(java.lang.Runnable task)
      Deprecated.
      Specified by:
      submit in interface EventExecutorGroup
      Specified by:
      submit in interface java.util.concurrent.ExecutorService
      Overrides:
      submit in class java.util.concurrent.ScheduledThreadPoolExecutor
    • submit

      public <T> Future<T> submit(java.lang.Runnable task, T result)
      Deprecated.
      Specified by:
      submit in interface EventExecutorGroup
      Specified by:
      submit in interface java.util.concurrent.ExecutorService
      Overrides:
      submit in class java.util.concurrent.ScheduledThreadPoolExecutor
    • submit

      public <T> Future<T> submit(java.util.concurrent.Callable<T> task)
      Deprecated.
      Specified by:
      submit in interface EventExecutorGroup
      Specified by:
      submit in interface java.util.concurrent.ExecutorService
      Overrides:
      submit in class java.util.concurrent.ScheduledThreadPoolExecutor
    • execute

      public void execute(java.lang.Runnable command)
      Deprecated.
      Specified by:
      execute in interface java.util.concurrent.Executor
      Overrides:
      execute in class java.util.concurrent.ScheduledThreadPoolExecutor