- 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 TypeMethodDescriptionvoidExecutes the runnables of thebatchconcurrently and returns, when all tasks have been executed.static BatchExecutorCreate a batch executor, where the execution is forwarded to the givenexecutor.static BatchExecutorReturn a batch executor, where each task of a given batch is executed in its own virtual thread.
-
Method Details
-
execute
Executes the runnables of thebatchconcurrently and returns, when all tasks have been executed.- Parameters:
batch- the sequence of runnable to be executed concurrently- Throws:
NullPointerException- if the givenbatchisnull
-
of
Create a batch executor, where the execution is forwarded to the givenexecutor.- Parameters:
executor- the executor, which is actually executing the tasks- Returns:
- a new batch executor
- Throws:
NullPointerException- if the givenexecutorisnull
-
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
-