Package io.micronaut.scheduling.executor
Class ExecutorFactory
- java.lang.Object
-
- io.micronaut.scheduling.executor.ExecutorFactory
-
@Factory public class ExecutorFactory extends java.lang.ObjectConstructsExecutorServiceinstances based onUserExecutorConfigurationinstances.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description ExecutorFactory(io.micronaut.context.BeanLocator beanLocator, java.util.concurrent.ThreadFactory threadFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.concurrent.ThreadFactoryeventLoopGroupThreadFactory(ExecutorConfiguration configuration)Constructs an executor thread factory.java.util.concurrent.ExecutorServiceexecutorService(ExecutorConfiguration executorConfiguration)Create the ExecutorService with the given configuration.
-
-
-
Method Detail
-
eventLoopGroupThreadFactory
@EachBean(ExecutorConfiguration.class) protected java.util.concurrent.ThreadFactory eventLoopGroupThreadFactory(ExecutorConfiguration configuration)
Constructs an executor thread factory.- Parameters:
configuration- The configuration- Returns:
- The thread factory
-
executorService
@EachBean(ExecutorConfiguration.class) @Bean(preDestroy="shutdown") public java.util.concurrent.ExecutorService executorService(ExecutorConfiguration executorConfiguration)
Create the ExecutorService with the given configuration.- Parameters:
executorConfiguration- The configuration to create a thread pool that creates new threads as needed- Returns:
- A thread pool that creates new threads as needed
-
-