package cn.gistack.common.config;
|
|
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Configuration;
|
|
import java.util.concurrent.LinkedBlockingDeque;
|
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.TimeUnit;
|
|
/**
|
* 自定义线程池
|
* @author zhongrj
|
*/
|
@Configuration
|
public class MyThreadPoolConfig {
|
|
@Bean
|
public ThreadPoolExecutor threadPoolExecutor() {
|
return new ThreadPoolExecutor(
|
6,
|
12,
|
60,
|
TimeUnit.SECONDS,
|
new LinkedBlockingDeque<>(10000),
|
new ThreadPoolExecutor.AbortPolicy()
|
);
|
}
|
}
|