Class TaskExecutor

    • Constructor Detail

      • TaskExecutor

        public TaskExecutor()
    • Method Detail

      • addParallelTasks

        public void addParallelTasks​(java.util.List<? extends java.lang.Runnable> parallelTasks)
        Description copied from interface: ITaskExecutor
        Add parallel stage with provided tasks
        Specified by:
        addParallelTasks in interface ITaskExecutor
      • addSequentialTasks

        public void addSequentialTasks​(java.util.List<? extends java.lang.Runnable> seqTasks)
        Description copied from interface: ITaskExecutor
        Add sequential stage with provided tasks
        Specified by:
        addSequentialTasks in interface ITaskExecutor
      • addSequentialTask

        public void addSequentialTask​(java.lang.Runnable seqTask)
        Description copied from interface: ITaskExecutor
        Add sequential stage with a single task
        Specified by:
        addSequentialTask in interface ITaskExecutor
      • setThreadsCount

        public void setThreadsCount​(int count)
        Description copied from interface: ITaskExecutor
        Set threads count for parallel stage. Can be changed during execution. Defaults to half of processors count.
        Specified by:
        setThreadsCount in interface ITaskExecutor
      • terminate

        public void terminate()
        Description copied from interface: ITaskExecutor
        Not started tasks will be not executed after this method invocation.
        Specified by:
        terminate in interface ITaskExecutor
      • getInternalExecutor

        @Nullable
        public @Nullable java.util.concurrent.ExecutorService getInternalExecutor()
        Description copied from interface: ITaskExecutor
        Return internal executor service.
        Specified by:
        getInternalExecutor in interface ITaskExecutor
      • awaitExecutorTermination

        public static void awaitExecutorTermination​(java.util.concurrent.ExecutorService executor)