@Singleton public class DefaultExecutorSelector extends Object implements ExecutorSelector
ExecutorSelector
interface that regards methods that return reactive types as non-blocking.Modifier | Constructor and Description |
---|---|
protected |
DefaultExecutorSelector(BeanLocator beanLocator,
Provider<ExecutorService> ioExecutor)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Optional<ExecutorService> |
select(MethodReference method,
ThreadSelection threadSelection)
Select an
ExecutorService for the given MethodReference . |
protected DefaultExecutorSelector(BeanLocator beanLocator, @Named(value="io") Provider<ExecutorService> ioExecutor)
beanLocator
- The bean locatorioExecutor
- The IO executorpublic Optional<ExecutorService> select(MethodReference method, ThreadSelection threadSelection)
ExecutorSelector
ExecutorService
for the given MethodReference
.select
in interface ExecutorSelector
method
- The MethodReference
threadSelection
- The thread selection modeExecutorService
. If an ExecutorService
cannot be established
Optional.empty()
is returned