- 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 TypeMethodDescriptionvoid
Executes the runnables of thebatch
concurrently and returns, when all tasks have been executed.static BatchExecutor
Create a batch executor, where the execution is forwarded to the givenexecutor
.static BatchExecutor
Return a batch executor, where each task of a given batch is executed in its own virtual thread.
-
Method Details
-
execute
Executes the runnables of thebatch
concurrently and returns, when all tasks have been executed.- Parameters:
batch
- the sequence of runnable to be executed concurrently- Throws:
NullPointerException
- if the givenbatch
isnull
-
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 givenexecutor
isnull
-
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
-