[improvement][common] The thread pool adopts a generic thread pool configuration. (#1966)

This commit is contained in:
lexluo09
2024-12-21 19:01:53 +08:00
committed by GitHub
parent 7b49412bde
commit 72780f9acf
5 changed files with 26 additions and 20 deletions

View File

@@ -26,4 +26,12 @@ public class ThreadPoolConfig {
new ThreadFactoryBuilder().setNameFormat("supersonic-map-pool-").build(),
new ThreadPoolExecutor.CallerRunsPolicy());
}
@Bean("chatExecutor")
public ThreadPoolExecutor getChatExecutor() {
return new ThreadPoolExecutor(8, 16, 60 * 3, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(1024),
new ThreadFactoryBuilder().setNameFormat("supersonic-chat-pool-").build(),
new ThreadPoolExecutor.CallerRunsPolicy());
}
}