|
|
@ -47,27 +47,22 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
class TaskExecutorConfigurations {
|
|
|
|
class TaskExecutorConfigurations {
|
|
|
|
|
|
|
|
|
|
|
|
@ConditionalOnThreading(Threading.VIRTUAL)
|
|
|
|
|
|
|
|
@Configuration(proxyBeanMethods = false)
|
|
|
|
@Configuration(proxyBeanMethods = false)
|
|
|
|
@ConditionalOnMissingBean(Executor.class)
|
|
|
|
@ConditionalOnMissingBean(Executor.class)
|
|
|
|
static class VirtualThreadTaskExecutorConfiguration {
|
|
|
|
@SuppressWarnings("removal")
|
|
|
|
|
|
|
|
static class TaskExecutorConfiguration {
|
|
|
|
|
|
|
|
|
|
|
|
@Bean(name = { TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME,
|
|
|
|
@Bean(name = { TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME,
|
|
|
|
AsyncAnnotationBeanPostProcessor.DEFAULT_TASK_EXECUTOR_BEAN_NAME })
|
|
|
|
AsyncAnnotationBeanPostProcessor.DEFAULT_TASK_EXECUTOR_BEAN_NAME })
|
|
|
|
SimpleAsyncTaskExecutor applicationTaskExecutor(SimpleAsyncTaskExecutorBuilder builder) {
|
|
|
|
@ConditionalOnThreading(Threading.VIRTUAL)
|
|
|
|
|
|
|
|
SimpleAsyncTaskExecutor applicationTaskExecutorVirtualThreads(SimpleAsyncTaskExecutorBuilder builder) {
|
|
|
|
return builder.build();
|
|
|
|
return builder.build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Configuration(proxyBeanMethods = false)
|
|
|
|
|
|
|
|
@ConditionalOnMissingBean(Executor.class)
|
|
|
|
|
|
|
|
@SuppressWarnings("removal")
|
|
|
|
|
|
|
|
static class ThreadPoolTaskExecutorConfiguration {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Lazy
|
|
|
|
@Lazy
|
|
|
|
@Bean(name = { TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME,
|
|
|
|
@Bean(name = { TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME,
|
|
|
|
AsyncAnnotationBeanPostProcessor.DEFAULT_TASK_EXECUTOR_BEAN_NAME })
|
|
|
|
AsyncAnnotationBeanPostProcessor.DEFAULT_TASK_EXECUTOR_BEAN_NAME })
|
|
|
|
|
|
|
|
@ConditionalOnThreading(Threading.PLATFORM)
|
|
|
|
ThreadPoolTaskExecutor applicationTaskExecutor(TaskExecutorBuilder taskExecutorBuilder,
|
|
|
|
ThreadPoolTaskExecutor applicationTaskExecutor(TaskExecutorBuilder taskExecutorBuilder,
|
|
|
|
ObjectProvider<ThreadPoolTaskExecutorBuilder> threadPoolTaskExecutorBuilderProvider) {
|
|
|
|
ObjectProvider<ThreadPoolTaskExecutorBuilder> threadPoolTaskExecutorBuilderProvider) {
|
|
|
|
ThreadPoolTaskExecutorBuilder threadPoolTaskExecutorBuilder = threadPoolTaskExecutorBuilderProvider
|
|
|
|
ThreadPoolTaskExecutorBuilder threadPoolTaskExecutorBuilder = threadPoolTaskExecutorBuilderProvider
|
|
|
|