init
This commit is contained in:
@@ -17,6 +17,7 @@ public class ExecutorConstant {
|
||||
public static Executor SYNC_EXECUTOR;
|
||||
|
||||
public static Executor COMMON_EXECUTOR;
|
||||
public static Executor ROOM_EXECUTOR;
|
||||
|
||||
static {
|
||||
ThreadPoolExecutor syncExecutor = initExecutor(CPU_NUM,
|
||||
@@ -36,6 +37,15 @@ public class ExecutorConstant {
|
||||
new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
COMMON_EXECUTOR = TtlExecutors.getTtlExecutor(commonExecutor);
|
||||
|
||||
ThreadPoolExecutor roomExecutor = new ThreadPoolExecutor(CPU_NUM,
|
||||
CPU_NUM << 2,
|
||||
5,
|
||||
TimeUnit.SECONDS,
|
||||
new ArrayBlockingQueue<>(50),
|
||||
init("roomThreadPoll-%d"),
|
||||
new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
ROOM_EXECUTOR = TtlExecutors.getTtlExecutor(roomExecutor);
|
||||
|
||||
}
|
||||
|
||||
private static ThreadFactory init(String nameFormat){
|
||||
|
||||
Reference in New Issue
Block a user