Class SerialExecutor

  • All Implemented Interfaces:
    Executor

    public class SerialExecutor
    extends Object
    implements Executor
    See Executor docs
    Effectively creates a derived single thread executor, runnable tasks are executed in the order they are added. This is a replacement for Executors.newSingleThreadExecutor() that uses threads in a non-dedicated way
    Added shutdown support
    • Constructor Detail

      • SerialExecutor

        public SerialExecutor​(Executor executor)
    • Method Detail

      • scheduleNext

        protected void scheduleNext()
      • shutdownNow

        public void shutdownNow()
        Shutdown the executor without executing any more tasks.

        The the current task will be interrupting if it is not the thread that initiated the shutdown.

      • isShutdown

        public boolean isShutdown()