MCPcopy Create free account
hub / github.com/diyhi/bbs / taskExecutor

Method taskExecutor

src/main/java/cms/config/AsyncConfig.java:27–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26 //cms.web.action.quartz.Task.java类topicIndex()方法@Async("taskExecutor_topicIndex")调用
27 @Bean
28 public Executor taskExecutor() {
29 ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
30 executor.setCorePoolSize(corePoolSize);//核心线程池大小
31 executor.setMaxPoolSize(maxPoolSize);//最大线程数
32 //线程池对拒绝任务(无线程可用)的处理策略
33 executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());//处理的方法是运行计算任务,除非ThreadPoolExecutor被关闭,这样的话,任务会被丢弃
34
35 executor.initialize();
36 return executor;
37 }
38
39
40

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected