public static class HystrixThreadPool.HystrixThreadPoolDefault extends java.lang.Object implements HystrixThreadPool
HystrixThreadPool.Factory, HystrixThreadPool.HystrixThreadPoolDefault| Constructor and Description |
|---|
HystrixThreadPoolDefault(HystrixThreadPoolKey threadPoolKey,
HystrixThreadPoolProperties.Setter propertiesDefaults) |
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.ThreadPoolExecutor |
getExecutor()
Implementation of
ThreadPoolExecutor. |
rx.Scheduler |
getScheduler() |
rx.Scheduler |
getScheduler(rx.functions.Func0<java.lang.Boolean> shouldInterruptThread) |
boolean |
isQueueSpaceAvailable()
Whether the threadpool queue has space available according to the
queueSizeRejectionThreshold settings. |
void |
markThreadCompletion()
Mark when a thread completes executing a command.
|
void |
markThreadExecution()
Mark when a thread begins executing a command.
|
void |
markThreadRejection()
Mark when a command gets rejected from the threadpool
|
public HystrixThreadPoolDefault(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolProperties.Setter propertiesDefaults)
public java.util.concurrent.ThreadPoolExecutor getExecutor()
HystrixThreadPoolThreadPoolExecutor.getExecutor in interface HystrixThreadPoolpublic rx.Scheduler getScheduler()
getScheduler in interface HystrixThreadPoolpublic rx.Scheduler getScheduler(rx.functions.Func0<java.lang.Boolean> shouldInterruptThread)
getScheduler in interface HystrixThreadPoolpublic void markThreadExecution()
HystrixThreadPoolmarkThreadExecution in interface HystrixThreadPoolpublic void markThreadCompletion()
HystrixThreadPoolmarkThreadCompletion in interface HystrixThreadPoolpublic void markThreadRejection()
HystrixThreadPoolmarkThreadRejection in interface HystrixThreadPoolpublic boolean isQueueSpaceAvailable()
queueSizeRejectionThreshold settings.
Note that the queueSize is an final instance variable on HystrixThreadPoolDefault, and not looked up dynamically.
The data structure is static, so this does not make sense as a dynamic lookup.
The queueSizeRejectionThreshold can be dynamic (up to queueSize), so that should
still get checked on each invocation.
If a SynchronousQueue implementation is used (maxQueueSize <= 0), it always returns 0 as the size so this would always return true.
isQueueSpaceAvailable in interface HystrixThreadPool