iText 9.7.0 API
iText.Commons.Utils.MultiThreadingUtil Class Reference

Utility class for running actions in parallel using multiple threads. More...

Static Public Member Functions

static IList< T >  RunActionsParallel< T > (IList< Func< T >> actions, int numberOfThreads)
  Runs a list of Callable actions in parallel using a fixed thread pool. More...
 

Detailed Description

Utility class for running actions in parallel using multiple threads.

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.

Member Function Documentation

◆ RunActionsParallel< T >()

static IList iText.Commons.Utils.MultiThreadingUtil.RunActionsParallel< T > ( IList< Func< T >>  actions,
int  numberOfThreads 
)
inlinestatic

Runs a list of Callable actions in parallel using a fixed thread pool.

Parameters
actions the list of Callable actions to be executed
numberOfThreads the number of threads to use for parallel execution
Template Parameters
T the type of the result returned by the Callable actions
Returns
a list of results from the executed actions