Class ProcessorBase<T>

    • Constructor Detail

      • ProcessorBase

        public ProcessorBase​(Executor parent)
    • Method Detail

      • shutdown

        public void shutdown()
        It will shutdown and wait 30 seconds for timeout.
      • shutdown

        public void shutdown​(long timeout,
                             TimeUnit unit)
      • yield

        public void yield()
      • shutdownNow

        public int shutdownNow​(Consumer<? super T> onPendingItem,
                               int timeout,
                               TimeUnit unit)
        It will shutdown the executor however it will not wait for finishing tasks
      • doTask

        protected abstract void doTask​(T task)
      • isFlushed

        public final boolean isFlushed()
      • flush

        public final boolean flush​(long timeout,
                                   TimeUnit unit)
        WARNING: This will only flush when all the activity is suspended. don't expect success on this call if another thread keeps feeding the queue this is only valid on situations where you are not feeding the queue, like in shutdown and failover situations.
      • task

        protected void task​(T command)
      • remaining

        public final int remaining()
        Returns the remaining items to be processed.

        This method is safe to be called by different threads and its accuracy is subject to concurrent modifications.
        It is meant to be used only for test purposes, because of its O(n) cost.

      • status

        public final int status()