Interface ExecutorServiceBuilder
- All Superinterfaces:
BiFunction<AxonServerConfiguration,BlockingQueue<Runnable>, ExecutorService>
- 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 ExecutorServiceBuilder
extends BiFunction<AxonServerConfiguration,BlockingQueue<Runnable>,ExecutorService>
A Functional Interface towards a
BiFunction which ingests both an AxonServerConfiguration and a
BlockingQueue of Runnable, and outputs an ExecutorService. Provides a means to allow
configuration of the used ExecutorService in for example the AxonServerCommandBus,
but maintaining the option for the framework to provide a BlockingQueue which is tailored towards message
prioritization when building the executor.- Since:
- 4.2
- Author:
- Steven van Beelen
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ExecutorServiceBuilderCreate a default ExecutorServiceBuilder used to create aThreadPoolExecutorfor processing incoming commands.static ExecutorServiceBuilderCreate a default ExecutorServiceBuilder used to create aThreadPoolExecutorfor processing incoming queries.static ExecutorServiceBuilderCreate a default ExecutorServiceBuilder used to create aThreadPoolExecutorfor processing incoming query responses.Methods inherited from interface java.util.function.BiFunction
andThen, apply
-
Method Details
-
defaultCommandExecutorServiceBuilder
Create a default ExecutorServiceBuilder used to create aThreadPoolExecutorfor processing incoming commands. Uses theAxonServerConfiguration.getCommandThreads()as the core and maximum pool size, the givenBlockingQueueas theworkQueueand anAxonThreadFactory.- Returns:
- a default ExecutorServiceBuilder to create an executor for processing commands
-
defaultQueryExecutorServiceBuilder
Create a default ExecutorServiceBuilder used to create aThreadPoolExecutorfor processing incoming queries. Uses theAxonServerConfiguration.getQueryThreads()as the core and maximum pool size, the givenBlockingQueueas theworkQueueand anAxonThreadFactory.- Returns:
- a default ExecutorServiceBuilder to create an executor for processing queries
-
defaultQueryResponseExecutorServiceBuilder
Create a default ExecutorServiceBuilder used to create aThreadPoolExecutorfor processing incoming query responses. Uses theAxonServerConfiguration.getQueryResponseThreads()as the core and maximum pool size, the givenBlockingQueueas theworkQueueand anAxonThreadFactory.- Returns:
- a default ExecutorServiceBuilder to create an executor for processing incoming query responses
-