public BatchFraction threadPool ( final String name , final int maxThreads , final int keepAliveTime , final TimeUnit keepAliveUnits ) { final ThreadPool < ? > threadPool = new ThreadPool <> ( name ) ; threadPool . maxThreads ( maxThreads ) . keepaliveTime ( "time" , Integer . toBinaryString ( keepAliveTime ) ) . keepaliveTime ( "unit" , keepAliveUnits . name ( ) . toLowerCase ( Locale . ROOT ) ) ; return threadPool ( threadPool ) ; }
Creates a new thread - pool that can be used for batch jobs .