Package io.quarkus.runtime
Class ThreadPoolConfig
- java.lang.Object
-
- io.quarkus.runtime.ThreadPoolConfig
-
@ConfigRoot(phase=RUN_TIME) public class ThreadPoolConfig extends Object
The core thread pool config. This thread pool is responsible for running all blocking tasks.
-
-
Field Summary
Fields Modifier and Type Field Description int
coreThreads
The core thread pool size.float
growthResistance
The executor growth resistance.Duration
keepAliveTime
The amount of time a thread will stay alive with no work.OptionalInt
maxThreads
The maximum number of threads.boolean
prefill
Prefill core thread pool.OptionalInt
queueSize
The queue size.Optional<Duration>
shutdownCheckInterval
The frequency at which the status of the thread pool should be checked during shutdown.Duration
shutdownInterrupt
The amount of time to wait for thread pool shutdown before tasks should be interrupted.Duration
shutdownTimeout
The shutdown timeout.
-
Constructor Summary
Constructors Constructor Description ThreadPoolConfig()
-
-
-
Field Detail
-
coreThreads
@ConfigItem(defaultValue="1") public int coreThreads
The core thread pool size. This number of threads will always be kept alive.
-
prefill
@ConfigItem(defaultValue="true") public boolean prefill
Prefill core thread pool. The core thread pool will be initialised with the core number of threads at startup
-
maxThreads
@ConfigItem public OptionalInt maxThreads
The maximum number of threads. If this is not specified then it will be automatically sized to the greatest of 8 * the number of available processors and 200. For example if there are 4 processors the max threads will be 200. If there are 48 processors it will be 384.
-
queueSize
@ConfigItem public OptionalInt queueSize
The queue size. For most applications this should be unbounded
-
growthResistance
@ConfigItem public float growthResistance
The executor growth resistance. A resistance factor applied after the core pool is full; values applied here will cause that fraction of submissions to create new threads when no idle thread is available. A value of0.0f
implies that threads beyond the core size should be created as aggressively as threads within it; a value of1.0f
implies that threads beyond the core size should never be created.
-
shutdownTimeout
@ConfigItem(defaultValue="1M") public Duration shutdownTimeout
The shutdown timeout. If all pending work has not been completed by this time then additional threads will be spawned to attempt to finish any pending tasks, and the shutdown process will continue
-
shutdownInterrupt
@ConfigItem(defaultValue="10") public Duration shutdownInterrupt
The amount of time to wait for thread pool shutdown before tasks should be interrupted. If this value is greater than or equal to the value forshutdownTimeout
, then tasks will not be interrupted before the shutdown timeout occurs.
-
shutdownCheckInterval
@ConfigItem(defaultValue="5") public Optional<Duration> shutdownCheckInterval
The frequency at which the status of the thread pool should be checked during shutdown. Information about waiting tasks and threads will be checked and possibly logged at this interval. Setting this key to an empty value disables the shutdown check interval.
-
keepAliveTime
@ConfigItem(defaultValue="30") public Duration keepAliveTime
The amount of time a thread will stay alive with no work.
-
-
Method Detail
-
empty
public static ThreadPoolConfig empty()
-
-