Package com.helger.commons.concurrent
Interface IExecutorServiceFactory
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface IExecutorServiceFactory
Factory for creatingExecutorServiceinstances.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExecutorServicegetExecutorService(int nParallelTasks)Get anExecutorServicefor the given number of parallel tasks.
-
-
-
Method Detail
-
getExecutorService
@Nonnull ExecutorService getExecutorService(@Nonnegative int nParallelTasks)
Get anExecutorServicefor the given number of parallel tasks. It is up to the implementation to interpret the value or not. The number of parallel tasks can therefore considered a hint to the implementation.- Parameters:
nParallelTasks- The number of parallel tasks to perform. Needs to be > 0.- Returns:
- A non-
nullExecutorServiceobject.
-
-