Package io.micronaut.scheduling.executor
Class ExecutorFactory
java.lang.Object
io.micronaut.scheduling.executor.ExecutorFactory
Constructs
ExecutorService
instances based on UserExecutorConfiguration
instances.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ThreadFactory
eventLoopGroupThreadFactory
(ExecutorConfiguration configuration) Constructs an executor thread factory.executorService
(ExecutorConfiguration executorConfiguration) Create the ExecutorService with the given configuration.
-
Constructor Details
-
ExecutorFactory
- Parameters:
beanLocator
- The bean beanLocatorthreadFactory
- The factory to create new threads- Since:
- 2.0.1
-
-
Method Details
-
eventLoopGroupThreadFactory
@EachBean(ExecutorConfiguration.class) protected 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 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
-