Class DaemonThreadPool


  • public class DaemonThreadPool
    extends Object
    Build thread pools that even when not properly shutdown, will still not prevent the termination of the JVM.
    • Method Detail

      • buildConstrainedCached

        public static ExecutorService buildConstrainedCached​(String name,
                                                             int maxThreads)
        Generate a thread pool that will reuse threads, clear them after a while, but constrain the total amount of threads.
        Parameters:
        name - name of the thread pool
        maxThreads - the maximum amount of threads to start in this pool, after this things will get queued.
        Returns:
        an exectutor with deamon threads and constainted to a certain maximum