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

    • Constructor Detail

      • UnorderedThreadPoolEventExecutor

        public UnorderedThreadPoolEventExecutor​(int corePoolSize,
                                                java.util.concurrent.ThreadFactory threadFactory)
        Deprecated.
        See ScheduledThreadPoolExecutor(int, ThreadFactory)
      • UnorderedThreadPoolEventExecutor

        public UnorderedThreadPoolEventExecutor​(int corePoolSize,
                                                java.util.concurrent.ThreadFactory threadFactory,
                                                java.util.concurrent.RejectedExecutionHandler handler)
        Deprecated.
        See ScheduledThreadPoolExecutor(int, ThreadFactory, RejectedExecutionHandler)
    • Method Detail

      • 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
      • 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
      • 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​(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()
      • 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