public class ThreadPoolProvider extends com.yahoo.component.AbstractComponent implements com.yahoo.container.di.componentgraph.Provider<Executor>
Modifier and Type | Class and Description |
---|---|
private static class |
ThreadPoolProvider.ExecutorServiceWrapper
A service executor wrapper which emits metrics and
shuts down the vm when no workers are available for too long to avoid containers lingering in a blocked state.
|
private static class |
ThreadPoolProvider.WorkerCompletionTimingThreadPoolExecutor
A thread pool executor which maintains the last time a worker completed
|
Modifier and Type | Field and Description |
---|---|
private ThreadPoolProvider.ExecutorServiceWrapper |
threadpool |
Constructor and Description |
---|
ThreadPoolProvider(ThreadpoolConfig threadpoolConfig,
com.yahoo.jdisc.Metric metric) |
ThreadPoolProvider(ThreadpoolConfig threadpoolConfig,
com.yahoo.jdisc.Metric metric,
ProcessTerminator processTerminator) |
Modifier and Type | Method and Description |
---|---|
void |
deconstruct()
Shutdown the thread pool, give a grace period of 1 second before forcibly
shutting down all worker threads.
|
Executor |
get()
Get the Executor provided by this class.
|
private final ThreadPoolProvider.ExecutorServiceWrapper threadpool
@Inject public ThreadPoolProvider(ThreadpoolConfig threadpoolConfig, com.yahoo.jdisc.Metric metric)
public ThreadPoolProvider(ThreadpoolConfig threadpoolConfig, com.yahoo.jdisc.Metric metric, ProcessTerminator processTerminator)
public Executor get()
get
in interface com.yahoo.container.di.componentgraph.Provider<Executor>
public void deconstruct()
deconstruct
in interface com.yahoo.container.di.componentgraph.Provider<Executor>
deconstruct
in class com.yahoo.component.AbstractComponent
Copyright © 2017. All rights reserved.