Class ThreadPoolProvider

  • All Implemented Interfaces:
    com.yahoo.component.Component, com.yahoo.component.Deconstructable, com.yahoo.container.di.componentgraph.Provider<Executor>, Comparable<com.yahoo.component.Component>

    public class ThreadPoolProvider
    extends com.yahoo.component.AbstractComponent
    implements com.yahoo.container.di.componentgraph.Provider<Executor>
    A configurable thread pool provider. This provides the worker threads used for normal request processing. Request an Executor injected in your component constructor if you want to use it.
    Author:
    Steinar Knutsen, baldersheim, bratseth
    • Constructor Detail

      • ThreadPoolProvider

        @Inject
        public ThreadPoolProvider​(ThreadpoolConfig config,
                                  com.yahoo.jdisc.Metric metric)
    • Method Detail

      • get

        public Executor get()
        Get the Executor provided by this class. This Executor will by default also be used for search queries and processing requests.
        Specified by:
        get in interface com.yahoo.container.di.componentgraph.Provider<Executor>
        Returns:
        a possibly shared executor
      • deconstruct

        public void deconstruct()
        Shut down the thread pool, give a grace period of 1 second before forcibly shutting down all worker threads.
        Specified by:
        deconstruct in interface com.yahoo.component.Deconstructable
        Overrides:
        deconstruct in class com.yahoo.component.AbstractComponent