Class ThreadPoolSupplier

java.lang.Object
io.helidon.common.configurable.ThreadPoolSupplier
All Implemented Interfaces:
Supplier<ExecutorService>

public final class ThreadPoolSupplier extends Object implements Supplier<ExecutorService>
Supplier of a custom thread pool. The returned thread pool supports Context propagation.
  • Method Details

    • builder

      public static ThreadPoolSupplier.Builder builder()
      Create a new fluent API builder to build thread pool supplier.
      Returns:
      a builder instance
    • create

      public static ThreadPoolSupplier create(Config config, String name)
      Load supplier from configuration.
      Parameters:
      config - config instance
      name - thread pool name
      Returns:
      a new thread pool supplier configured from config
    • create

      public static ThreadPoolSupplier create(String name)
      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
    • get

      public ExecutorService get()
      Specified by:
      get in interface Supplier<ExecutorService>
    • corePoolSize

      public int corePoolSize()
      Returns size of core pool.
      Returns:
      size of core pool.