Package io.micronaut.scheduling.executor
Class DefaultExecutorSelector
- java.lang.Object
-
- io.micronaut.scheduling.executor.DefaultExecutorSelector
-
- All Implemented Interfaces:
ExecutorSelector
@Singleton public class DefaultExecutorSelector extends java.lang.Object implements ExecutorSelector
Default implementation of theExecutorSelectorinterface that regards methods that return reactive types as non-blocking.- Since:
- 1.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultExecutorSelector(io.micronaut.context.BeanLocator beanLocator, io.micronaut.context.BeanProvider<java.util.concurrent.ExecutorService> ioExecutor)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.util.concurrent.ExecutorService>select(io.micronaut.inject.MethodReference method, ThreadSelection threadSelection)Select anExecutorServicefor the givenMethodReference.java.util.Optional<java.util.concurrent.ExecutorService>select(java.lang.String name)Obtain executor for the given name.
-
-
-
Constructor Detail
-
DefaultExecutorSelector
@Inject protected DefaultExecutorSelector(io.micronaut.context.BeanLocator beanLocator, @Named("io") io.micronaut.context.BeanProvider<java.util.concurrent.ExecutorService> ioExecutor)Default constructor.- Parameters:
beanLocator- The bean locatorioExecutor- The IO executor
-
-
Method Detail
-
select
public java.util.Optional<java.util.concurrent.ExecutorService> select(io.micronaut.inject.MethodReference method, ThreadSelection threadSelection)Description copied from interface:ExecutorSelectorSelect anExecutorServicefor the givenMethodReference.- Specified by:
selectin interfaceExecutorSelector- Parameters:
method- TheMethodReferencethreadSelection- The thread selection mode- Returns:
- An optional
ExecutorService. If anExecutorServicecannot be establishedOptional.empty()is returned
-
select
public java.util.Optional<java.util.concurrent.ExecutorService> select(java.lang.String name)
Description copied from interface:ExecutorSelectorObtain executor for the given name.- Specified by:
selectin interfaceExecutorSelector- Parameters:
name- The name of the executor- Returns:
- An executor if it exists
-
-