案件列表联调

This commit is contained in:
18792927508
2024-01-11 15:30:10 +08:00
parent 1554139f18
commit 45b2b7c272
13 changed files with 714 additions and 139 deletions
@@ -0,0 +1,23 @@
package com.ruoyi.common.utils;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import java.util.concurrent.*;
/**
* @Author: ymbgy
* @Date: 2022-09-23 10:06
*/
public class ThreadUtil {
public static ExecutorService createThreadPool() {
//获取系统处理器个数,作为线程池数量
int nThreads = Runtime.getRuntime().availableProcessors();
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder()
.setNameFormat("demo-pool-%d").build();
//Thread Pool
ExecutorService executor = new ThreadPoolExecutor(nThreads, 200,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy());
return executor;
}
}