Package io.helidon.common.configurable
Class ThreadPoolSupplier
java.lang.Object
io.helidon.common.configurable.ThreadPoolSupplier
- All Implemented Interfaces:
RuntimeType.Api<ThreadPoolConfig>,Supplier<ExecutorService>
public final class ThreadPoolSupplier
extends Object
implements Supplier<ExecutorService>, RuntimeType.Api<ThreadPoolConfig>
Supplier of a custom thread pool.
The returned thread pool supports
Context propagation.-
Method Summary
Modifier and TypeMethodDescriptionstatic ThreadPoolConfig.Builderbuilder()Create a new fluent API builder to build thread pool supplier.intReturns size of core pool.static ThreadPoolSupplierLoad supplier from configuration.static ThreadPoolSuppliercreate(ThreadPoolConfig config) Create a new thread pool supplier based on its configuration.static ThreadPoolSupplierCreate a new thread pool supplier with default configuration and a given name.static ThreadPoolSuppliercreate(Consumer<ThreadPoolConfig.Builder> consumer) Create a new thread pool supplier customizing its configuration.get()The prototype as it was received when creating this runtime object instance.
-
Method Details
-
builder
Create a new fluent API builder to build thread pool supplier.- Returns:
- a builder instance
-
create
Load supplier from configuration.- Parameters:
config- config instancename- thread pool name- Returns:
- a new thread pool supplier configured from config
-
create
Create a new thread pool supplier with default configuration and a given name.- Parameters:
name- thread pool name- Returns:
- a new thread pool supplier with default configuration
-
create
Create a new thread pool supplier based on its configuration.- Parameters:
config- configuration- Returns:
- a new thread pool supplier
-
create
Create a new thread pool supplier customizing its configuration.- Parameters:
consumer- configuration consumer- Returns:
- a new thread pool supplier
-
prototype
Description copied from interface:RuntimeType.ApiThe prototype as it was received when creating this runtime object instance.- Specified by:
prototypein interfaceRuntimeType.Api<ThreadPoolConfig>- Returns:
- prototype object used to create this instance
-
get
- Specified by:
getin interfaceSupplier<ExecutorService>
-
corePoolSize
public int corePoolSize()Returns size of core pool.- Returns:
- size of core pool.
-