Class MultiThreadingUtil

java.lang.Object
com.itextpdf.commons.utils.MultiThreadingUtil

public class MultiThreadingUtil extends Object
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 Details

    • runActionsParallel

      public static  List runActionsParallel (List<Callable> actions, int numberOfThreads)
      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