[improvement][headless]Setup thread pool for data event listeners.

This commit is contained in:
jerryjzhang
2025-01-02 15:27:24 +08:00
parent 22f6190e7c
commit 83cb6967e7
3 changed files with 16 additions and 8 deletions

View File

@@ -11,6 +11,14 @@ import java.util.concurrent.TimeUnit;
@Component
public class ThreadPoolConfig {
@Bean("eventExecutor")
public ThreadPoolExecutor getTaskEventExecutor() {
return new ThreadPoolExecutor(4, 8, 60 * 3, TimeUnit.SECONDS,
new LinkedBlockingQueue<>(1024),
new ThreadFactoryBuilder().setNameFormat("supersonic-event-pool-").build(),
new ThreadPoolExecutor.CallerRunsPolicy());
}
@Bean("commonExecutor")
public ThreadPoolExecutor getCommonExecutor() {
return new ThreadPoolExecutor(8, 16, 60 * 3, TimeUnit.SECONDS,