public static ScheduledExecutorService defaultExecutorService ( ) { ScheduledExecutorService scheduledExecutorService = Executors . newScheduledThreadPool ( getCpuCount ( ) ) ; Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( ( ) -> shutdown ( scheduledExecutorService ) ) ) ; return scheduledExecutorService ; }
Provide a new ScheduledExecutorService instance .