Class EvenMoreExecutors
java.lang.Object
com.sk89q.worldguard.util.concurrent.EvenMoreExecutors
Provides additional executors.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutorServicenewBoundedCachedThreadPool(int minThreads, int maxThreads, int queueSize)Creates a thread pool that creates new threads as needed up to a maximum number of threads, but will reuse previously constructed threads when they are available.static ExecutorServicenewBoundedCachedThreadPool(int minThreads, int maxThreads, int queueSize, String threadFormat)Creates a thread pool that creates new threads as needed up to a maximum number of threads, but will reuse previously constructed threads when they are available.
-
Method Details
-
newBoundedCachedThreadPool
public static ExecutorService newBoundedCachedThreadPool(int minThreads, int maxThreads, int queueSize)Creates a thread pool that creates new threads as needed up to a maximum number of threads, but will reuse previously constructed threads when they are available.- Parameters:
minThreads- the minimum number of threads to have at a given timemaxThreads- the maximum number of threads to have at a given timequeueSize- the size of the queue before new submissions are rejected- Returns:
- the newly created thread pool
-
newBoundedCachedThreadPool
public static ExecutorService newBoundedCachedThreadPool(int minThreads, int maxThreads, int queueSize, String threadFormat)Creates a thread pool that creates new threads as needed up to a maximum number of threads, but will reuse previously constructed threads when they are available.- Parameters:
minThreads- the minimum number of threads to have at a given timemaxThreads- the maximum number of threads to have at a given timequeueSize- the size of the queue before new submissions are rejectedthreadFormat- thread name formatter- Returns:
- the newly created thread pool
-