public interface ThreadPoolProvider
| Modifier and Type | Method and Description |
|---|---|
ThreadProvider |
getThreadProvider() |
ThreadPoolExecutor |
newFixedThreadPool(int threads,
String threadNamePrefix)
Creates a new fixed size
ThreadPoolExecutor. |
ThreadPoolExecutor |
newFixedThreadPool(int threads,
String threadNamePrefix,
int queueSize)
Creates a new fixed size
ThreadPoolExecutor. |
ScheduledExecutorService |
newScheduledThreadPool(String threadNamePrefix)
Creates an executor for recurring tasks
|
ThreadProvider getThreadProvider()
ThreadPoolExecutor newFixedThreadPool(int threads, String threadNamePrefix)
ThreadPoolExecutor.
It's using a blocking queue of maximum 1000 elements and the rejection policy is set to block until the queue can accept the task. These settings are required to cap the queue, to make sure the timeouts are reasonable for most jobs.
threads - the number of threadsthreadNamePrefix - a label to identify the threads; useful for profiling.ThreadPoolExecutor newFixedThreadPool(int threads, String threadNamePrefix, int queueSize)
ThreadPoolExecutor.
It's using a blocking queue of maximum queueSize elements and the rejection
policy is set to block until the queue can accept the task.
These settings are required to cap the queue, to make sure the
timeouts are reasonable for most jobs.
threads - the number of threadsthreadNamePrefix - a label to identify the threads; useful for profiling.queueSize - the size of the queue to store Runnables when all threads are busyScheduledExecutorService newScheduledThreadPool(String threadNamePrefix)
threadNamePrefix - a label to identify the threads; useful for profiling.ScheduledExecutorServiceCopyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.