Interface ITaskExecutor

All Known Implementing Classes:
TaskExecutor

public interface ITaskExecutor
Schedule and execute tasks combined into stages with parallel or sequential execution (similar to the fork-join pattern).
  • Method Details

    • addParallelTasks

      void addParallelTasks(List<? extends Runnable> parallelTasks)
      Add parallel stage with provided tasks
    • addSequentialTasks

      void addSequentialTasks(List<? extends Runnable> seqTasks)
      Add sequential stage with provided tasks
    • addSequentialTask

      void addSequentialTask(Runnable task)
      Add sequential stage with a single task
    • getTasksCount

      int getTasksCount()
      Scheduled tasks count
    • setThreadsCount

      void setThreadsCount(int threadsCount)
      Set threads count for parallel stage. Can be changed during execution. Defaults to half of processors count.
    • getThreadsCount

      int getThreadsCount()
    • execute

      void execute()
      Start tasks execution.
    • getProgress

      int getProgress()
    • terminate

      void terminate()
      Not started tasks will be not executed after this method invocation.
    • isTerminating

      boolean isTerminating()
    • isRunning

      boolean isRunning()
    • awaitTermination

      void awaitTermination()
      Block until execution is finished
    • getInternalExecutor

      @Nullable @Nullable ExecutorService getInternalExecutor()
      Return internal executor service.