mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
21 lines
599 B
Java
21 lines
599 B
Java
package xyz.zinglizingli.books.util;
|
|
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.Executors;
|
|
|
|
public class ExcutorUtils {
|
|
|
|
private static ExecutorService fixedThreadPool;
|
|
private static ExecutorService cachedThreadPool ;
|
|
static{
|
|
fixedThreadPool = Executors.newFixedThreadPool(5);
|
|
cachedThreadPool = Executors.newCachedThreadPool();
|
|
}
|
|
public static void excuteFixedTask(Runnable task){
|
|
fixedThreadPool.execute(task);
|
|
}
|
|
public static void excuteCachedTask(Runnable task){
|
|
cachedThreadPool.execute(task);
|
|
}
|
|
}
|