use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project faf-java-server by FAForever.
the class LegacyAdapterConfig method createNioTaskExecutor.
@NotNull
private Executor createNioTaskExecutor(String threadNamePrefix) {
ThreadPoolTaskExecutor ioExecutor = new ThreadPoolTaskExecutor();
ioExecutor.setCorePoolSize(1);
ioExecutor.setMaxPoolSize(4);
ioExecutor.setQueueCapacity(0);
ioExecutor.setThreadNamePrefix(threadNamePrefix);
ioExecutor.setRejectedExecutionHandler(new AbortPolicy());
ioExecutor.initialize();
return ioExecutor;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project spring-cloud-gcp by spring-cloud.
the class CloudVisionAutoConfiguration method cloudVisionExecutor.
@Bean
@ConditionalOnMissingBean(name = "cloudVisionExecutor")
public Executor cloudVisionExecutor() {
ThreadPoolTaskExecutor ackExecutor = new ThreadPoolTaskExecutor();
ackExecutor.setMaxPoolSize(this.cloudVisionProperties.getExecutorThreadsCount());
ackExecutor.setThreadNamePrefix("gcp-cloud-vision-ocr-executor");
ackExecutor.setDaemon(true);
return ackExecutor;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project data-prep by Talend.
the class TaskExecution method dataPrepAsyncTaskExecutor.
/**
* @return an Authenticated task executor for event multi casting.
* @see DataPrepEvents
*/
@Bean(name = "applicationEventMulticaster#executor")
public TaskExecutor dataPrepAsyncTaskExecutor() {
final ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.setCorePoolSize(2);
taskExecutor.setMaxPoolSize(10);
taskExecutor.setWaitForTasksToCompleteOnShutdown(false);
taskExecutor.initialize();
return taskExecutor;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project data-prep by Talend.
the class TaskExecution method getAsyncExecutor.
/**
* @return an Authenticated task executor ready to run.
*/
protected AsyncListenableTaskExecutor getAsyncExecutor() {
final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(2);
executor.setMaxPoolSize(10);
executor.setWaitForTasksToCompleteOnShutdown(false);
executor.initialize();
return executor;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project data-prep by Talend.
the class AsyncAspectTest method getManagedTaskExecutorEngine.
@Bean(name = "managedTaskEngine")
public TaskExecutor getManagedTaskExecutorEngine() {
final ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
threadPoolTaskExecutor.setMaxPoolSize(1);
threadPoolTaskExecutor.setWaitForTasksToCompleteOnShutdown(false);
threadPoolTaskExecutor.initialize();
return threadPoolTaskExecutor;
}
Aggregations