/
allalex
/
Spring-AOP
Обзор
Документация
Войти
/
allalex
/
Spring-AOP
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/main/java/com/springaopopenschool1/firsttask/configuration/AsyncConfiguration.java
23 строки
759 B
Alexey Layko
init commit
08 май 2024, 09:46
08 май 2024, 09:46
22e399a
Код
Авторство
О чём код?
package com.springaopopenschool1.firsttask.configuration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import java.util.concurrent.Executor; @Configuration public class AsyncConfiguration { @Bean(name = "customExecutor") public Executor customExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(2); executor.setMaxPoolSize(10); executor.setQueueCapacity(100); executor.setKeepAliveSeconds(60); executor.setThreadNamePrefix("CustomExecutor-"); executor.initialize(); return executor; } }