Interface ExecutorServiceFactory
- All Superinterfaces:
VertxServiceProvider
The interface for a factory used to obtain an external
ExecutorService.- Author:
- Gordon Hutchison
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ExecutorServiceFactoryDefault instance that delegates toExecutors.newFixedThreadPool(int, ThreadFactory) -
Method Summary
Modifier and TypeMethodDescriptioncreateExecutor(ThreadFactory threadFactory, Integer concurrency, Integer maxConcurrency) Create an ExecutorServicedefault voidinit(io.vertx.core.internal.VertxBootstrap builder) Let the provider initialize the Vert.x builder.
-
Field Details
-
INSTANCE
Default instance that delegates toExecutors.newFixedThreadPool(int, ThreadFactory)
-
-
Method Details
-
init
default void init(io.vertx.core.internal.VertxBootstrap builder) Description copied from interface:VertxServiceProviderLet the provider initialize the Vert.x builder.- Specified by:
initin interfaceVertxServiceProvider- Parameters:
builder- the builder
-
createExecutor
ExecutorService createExecutor(ThreadFactory threadFactory, Integer concurrency, Integer maxConcurrency) Create an ExecutorService- Parameters:
threadFactory- AThreadFactorywhich must be used by the createdExecutorServiceto create threads. Null indicates there is no requirement to use a specific factory.concurrency- The target level of concurrency or 0 which indicates unspecifiedmaxConcurrency- A hard limit to the level of concurrency required, should be greater thanconcurrencyor 0 which indicates unspecified.- Returns:
- an
ExecutorServicethat can be used to run tasks
-