@Singleton public class DefaultExecutorSelector extends java.lang.Object implements ExecutorSelector
ExecutorSelector interface that regards methods that return reactive types as non-blocking.| Modifier | Constructor and Description |
|---|---|
protected |
DefaultExecutorSelector(io.micronaut.context.BeanLocator beanLocator,
io.micronaut.context.BeanProvider<java.util.concurrent.ExecutorService> ioExecutor)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Optional<java.util.concurrent.ExecutorService> |
select(io.micronaut.inject.MethodReference method,
ThreadSelection threadSelection)
Select an
ExecutorService for the given MethodReference. |
java.util.Optional<java.util.concurrent.ExecutorService> |
select(java.lang.String name)
Obtain executor for the given name.
|
@Inject
protected DefaultExecutorSelector(io.micronaut.context.BeanLocator beanLocator,
@Named(value="io")
io.micronaut.context.BeanProvider<java.util.concurrent.ExecutorService> ioExecutor)
beanLocator - The bean locatorioExecutor - The IO executorpublic java.util.Optional<java.util.concurrent.ExecutorService> select(io.micronaut.inject.MethodReference method,
ThreadSelection threadSelection)
ExecutorSelectorExecutorService for the given MethodReference.select in interface ExecutorSelectormethod - The MethodReferencethreadSelection - The thread selection modeExecutorService. If an ExecutorService cannot be established
Optional.empty() is returnedpublic java.util.Optional<java.util.concurrent.ExecutorService> select(java.lang.String name)
ExecutorSelectorselect in interface ExecutorSelectorname - The name of the executor