Class 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 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 greater 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 of 0.0f implies that threads beyond the core size should be created as aggressively as threads within it; a value of 1.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 for shutdownTimeout, 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.
    • Constructor Detail

      • ThreadPoolConfig

        public ThreadPoolConfig()