Interface BatchExecutor

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

Batch executor interface, which is used for evaluating a batch of runnables. The tasks of a batch are executed concurrently and the execute(BaseSeq) method will return, if all tasks of the batch have been executed.
Since:
8.0
Version:
8.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(BaseSeq<? extends Runnable> batch)
    Executes the runnables of the batch concurrently and returns, when all tasks have been executed.
    of(Executor executor)
    Create a batch executor, where the execution is forwarded to the given executor.
    Return a batch executor, where each task of a given batch is executed in its own virtual thread.
  • Method Details

    • execute

      void execute(BaseSeq<? extends Runnable> batch)
      Executes the runnables of the batch concurrently and returns, when all tasks have been executed.
      Parameters:
      batch - the sequence of runnable to be executed concurrently
      Throws:
      NullPointerException - if the given batch is null
    • of

      static BatchExecutor of(Executor executor)
      Create a batch executor, where the execution is forwarded to the given executor.
      Parameters:
      executor - the executor, which is actually executing the tasks
      Returns:
      a new batch executor
      Throws:
      NullPointerException - if the given executor is null
    • ofVirtualThreads

      Return a batch executor, where each task of a given batch is executed in its own virtual thread.
      Returns:
      a new virtual thread batch executor object