Class ThreadPoolSupplier.Builder

    • Method Detail

      • queueCapacity

        public ThreadPoolSupplier.Builder queueCapacity​(int queueCapacity)
        Queue capacity of the thread pool executor.
        Parameters:
        queueCapacity - capacity of the queue backing the executor
        Returns:
        updated builder instance
      • daemon

        public ThreadPoolSupplier.Builder daemon​(boolean daemon)
        Is daemon of the thread pool executor.
        Parameters:
        daemon - whether the threads are daemon threads
        Returns:
        updated builder instance
      • name

        public ThreadPoolSupplier.Builder name​(String name)
        Name of this thread pool executor.
        Parameters:
        name - the pool name
        Returns:
        updated builder instance
      • threadNamePrefix

        public ThreadPoolSupplier.Builder threadNamePrefix​(String threadNamePrefix)
        Name prefix for threads in this thread pool executor.
        Parameters:
        threadNamePrefix - prefix of a thread name
        Returns:
        updated builder instance
      • prestart

        public ThreadPoolSupplier.Builder prestart​(boolean prestart)
        Whether to prestart core threads in this thread pool executor.
        Parameters:
        prestart - whether to prestart the threads
        Returns:
        updated builder instance
      • config

        public ThreadPoolSupplier.Builder config​(Config config)
        Load all properties for this thread pool executor from configuration. Expected keys:
        • core-pool-size
        • max-pool-size
        • keep-alive-minutes
        • queue-capacity
        • is-daemon
        • thread-name-prefix
        • should-prestart
        Parameters:
        config - config located on the key of executor-service
        Returns:
        updated builder instance