Class EvenMoreExecutors

java.lang.Object
com.sk89q.worldedit.util.concurrency.EvenMoreExecutors

public final class EvenMoreExecutors extends Object
Even more ExecutorService factory methods.
  • 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 time
      maxThreads - the maximum number of threads to have at a given time
      queueSize - 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 time
      maxThreads - the maximum number of threads to have at a given time
      queueSize - the size of the queue before new submissions are rejected
      threadFormat - thread name formatter
      Returns:
      the newly created thread pool