Top Description Methods
org.jooq

public Interface ExecutorProvider

Known Direct Implementers
org.jooq.impl.DefaultConfiguration.ExecutorWrapper, org.jooq.impl.DefaultExecutorProvider
Annotations
@FunctionalInterface
Imports
java.util.concurrent.Executor, .ForkJoinPool, org.jetbrains.annotations.NotNull

The ExecutorProvider SPI 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:

  1. If Configuration#executorProvider() does not return null, then provide() is called to obtain an Executor for the asynchronous task.
  2. In the jOOQ Java 8 distribution, ForkJoinPool#commonPool() is used if ForkJoinPool#getCommonPoolParallelism() > 1
  3. A new "one thread per call" Executor is 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 for ResultQuery#fetchAsync(Executor).

Author
Lukas Eder

Method Summary

Modifier and TypeMethod and Description
public @NotNull Executor
provide()

Provide an Executor for the task at hand.

Method Detail

provideback to summary
public @NotNull Executor provide()

Provide an Executor for the task at hand.

Annotations
@NotNull