mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 13:47:09 +00:00
[improvement][common] The thread pool adopts a generic thread pool configuration. (#1966)
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user