Class SaneThreadPoolExecutor

java.lang.Object
io.mats3.matssocket.impl.SaneThreadPoolExecutor
All Implemented Interfaces:
MatsSocketStatics, Executor

public class SaneThreadPoolExecutor extends Object implements Executor, MatsSocketStatics
Trick to make ThreadPoolExecutor work as anyone in the world would expect: Have a constant pool of "corePoolSize", and then as more tasks are concurrently running than threads available, you increase the number of threads until "maxPoolSize", at which point the rest go on queue. Snitched from https://stackoverflow.com/a/24493856.
  • Method Details

    • execute

      public void execute(Runnable command)
      Specified by:
      execute in interface Executor
    • shutdownNice

      public void shutdownNice(int gracefulShutdownMillis)