Class AbstractEventExecutor

    • Constructor Detail

      • AbstractEventExecutor

        protected AbstractEventExecutor()
    • Method Detail

      • submit

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

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

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

        protected final <T> java.util.concurrent.RunnableFuture<T> newTaskFor​(java.lang.Runnable runnable,
                                                                              T value)
        Overrides:
        newTaskFor in class java.util.concurrent.AbstractExecutorService
      • newTaskFor

        protected final <T> java.util.concurrent.RunnableFuture<T> newTaskFor​(java.util.concurrent.Callable<T> callable)
        Overrides:
        newTaskFor in class java.util.concurrent.AbstractExecutorService
      • schedule

        public ScheduledFuture<?> schedule​(java.lang.Runnable command,
                                           long delay,
                                           java.util.concurrent.TimeUnit unit)
        Specified by:
        schedule in interface EventExecutorGroup
        Specified by:
        schedule in interface java.util.concurrent.ScheduledExecutorService
      • schedule

        public <V> ScheduledFuture<V> schedule​(java.util.concurrent.Callable<V> callable,
                                               long delay,
                                               java.util.concurrent.TimeUnit unit)
        Specified by:
        schedule in interface EventExecutorGroup
        Specified by:
        schedule in interface java.util.concurrent.ScheduledExecutorService
      • scheduleAtFixedRate

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

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

        protected static void safeExecute​(java.lang.Runnable task)
        Try to execute the given Runnable and just log if it throws a Throwable.
      • runTask

        protected static void runTask​(java.lang.Runnable task)
      • lazyExecute

        @UnstableApi
        public void lazyExecute​(java.lang.Runnable task)
        Like Executor.execute(Runnable) but does not guarantee the task will be run until either a non-lazy task is executed or the executor is shut down.

        The default implementation just delegates to Executor.execute(Runnable).