public static interface MoreExecutors.ThreadPoolExecutorBuilder
| Modifier and Type | Method and Description |
|---|---|
CloseableExecutorService |
build()
Build the executor service.
|
MoreExecutors.ThreadPoolExecutorBuilder |
clearBlockWhenFull()
Disable block when full.
|
MoreExecutors.ThreadPoolExecutorBuilder |
setBlockWhenFull(int backlogSize)
Enable block when full.
|
MoreExecutors.ThreadPoolExecutorBuilder |
setFair(boolean fair)
If true, it will use a fair queue implementation for blockWhenFull.
|
MoreExecutors.ThreadPoolExecutorBuilder |
setFixed(boolean fixed)
Sets the queue to use a fixed set of threads.
|
MoreExecutors.ThreadPoolExecutorBuilder |
setFollowThreadLocals(boolean followThreadLocals)
Set whether or not to attempt to follow thread locals.
|
MoreExecutors.ThreadPoolExecutorBuilder |
setKeepAlive(long keepAlive,
TimeUnit timeUnit)
Sets the keep alive time.
|
MoreExecutors.ThreadPoolExecutorBuilder |
setMaxSize(int maxSize)
Sets the max number of threads in the thread pool.
|
MoreExecutors.ThreadPoolExecutorBuilder |
setShutdownTimeout(long timeout,
TimeUnit timeUnit)
Set the timeout for shutdown of this executor service
Defaults to 30 seconds
|
MoreExecutors.ThreadPoolExecutorBuilder |
setUnbounded(boolean unbounded)
If unbounded, the thread pool will behave like newCachedThreadPool().
|
MoreExecutors.ThreadPoolExecutorBuilder |
setWorkQueue(BlockingQueue<Runnable> workQueue)
Sets the work queue, which defaults to a LinkedBlockingQueue unless
blockWhenFull is true.
|
MoreExecutors.ThreadPoolExecutorBuilder setMaxSize(int maxSize)
Defaults to 20
MoreExecutors.ThreadPoolExecutorBuilder setKeepAlive(long keepAlive, TimeUnit timeUnit)
Defaults to 1 minutes.
MoreExecutors.ThreadPoolExecutorBuilder setWorkQueue(BlockingQueue<Runnable> workQueue)
DANGER! If you override the queue with blockWhenFull, be sure to set the capacity to coreSize + 1 if you value determinism.
MoreExecutors.ThreadPoolExecutorBuilder setFixed(boolean fixed)
If true, the thread pool will not timeout threads.
MoreExecutors.ThreadPoolExecutorBuilder setBlockWhenFull(int backlogSize)
backlogSize - - The amount of pending tasks before blocking.MoreExecutors.ThreadPoolExecutorBuilder setUnbounded(boolean unbounded)
Defaults to false.
MoreExecutors.ThreadPoolExecutorBuilder clearBlockWhenFull()
MoreExecutors.ThreadPoolExecutorBuilder setFair(boolean fair)
MoreExecutors.ThreadPoolExecutorBuilder setFollowThreadLocals(boolean followThreadLocals)
MoreExecutors.ThreadPoolExecutorBuilder setShutdownTimeout(long timeout, TimeUnit timeUnit)
CloseableExecutorService build()
Copyright © 2020. All rights reserved.