Package com.itextpdf.commons.utils
Class MultiThreadingUtil
java.lang.Object
com.itextpdf.commons.utils.MultiThreadingUtil
Utility class for running actions in parallel using multiple threads. This class provides a method to execute a list of Callable actions in parallel and collect their results.
-
Method Summary
Modifier and TypeMethodDescriptionstatic
List runActionsParallel
(List<Callable > actions, int numberOfThreads) Runs a list of Callable actions in parallel using a fixed thread pool.
-
Method Details
-
runActionsParallel
Runs a list of Callable actions in parallel using a fixed thread pool.- Type Parameters:
-
T
- the type of the result returned by the Callable actions - Parameters:
-
actions
- the list of Callable actions to be executed -
numberOfThreads
- the number of threads to use for parallel execution - Returns:
- a list of results from the executed actions
-