-
- All Known Implementing Classes:
DefaultExecutorProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ExecutorProvider
TheExecutorProviderSPI can be used to provide jOOQ with custom asynchronous execution behaviour.Asynchronous operations will call back to this SPI to obtain an executor. This applies, for example, to
ResultQuery.fetchAsync().The following logic is applied when resolving the appropriate
executor:- If
Configuration.executorProvider()does not returnnull, thenprovide()is called to obtain anExecutorfor the asynchronous task. - In the jOOQ Java 8 distribution,
ForkJoinPool.commonPool()is used ifForkJoinPool.getCommonPoolParallelism()> 1 - A new "one thread per call"
Executoris used in any other case.
The SPI will not be called if an asynchronous operation explicitly overrides the
Executor, e.g. as is the case forResultQuery.fetchAsync(Executor).- Author:
- Lukas Eder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Executorprovide()Provide anExecutorfor the task at hand.
-
-
-
Method Detail
-
provide
Executor provide()
Provide anExecutorfor the task at hand.
-
-