public class MemorySafeTaskQueue<R extends java.lang.Runnable> extends MemorySafeLinkedBlockingQueue<java.lang.Runnable> implements TaskQueue<java.lang.Runnable>
ShenyuThreadPoolExecutor.
It offer a task if the executor's submittedTaskCount less than currentPoolThreadSize
or the currentPoolThreadSize more than executor's maximumPoolSize.
That can make the executor create new worker
when the task num is bigger than corePoolSize but less than maximumPoolSize.| 构造器和说明 |
|---|
MemorySafeTaskQueue(java.util.Collection<? extends java.lang.Runnable> c,
int maxFreeMemory) |
MemorySafeTaskQueue(int maxFreeMemory) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
doOffer(java.lang.Runnable runnable)
offer element to the queue.
|
EagerExecutorService |
getExecutor()
get executor.
|
void |
setExecutor(EagerExecutorService executor)
set the executor.
|
getMaxFreeMemory, hasRemainedMemory, offer, offer, put, setMaxFreeMemory, setRejectorclear, contains, drainTo, drainTo, iterator, peek, poll, poll, remainingCapacity, remove, size, spliterator, take, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitoffer, retryOfferadd, contains, drainTo, drainTo, offer, poll, put, remainingCapacity, remove, takepublic MemorySafeTaskQueue(int maxFreeMemory)
public MemorySafeTaskQueue(java.util.Collection<? extends java.lang.Runnable> c,
int maxFreeMemory)
public EagerExecutorService getExecutor()
TaskQueuegetExecutor 在接口中 TaskQueue<java.lang.Runnable>public void setExecutor(EagerExecutorService executor)
TaskQueuesetExecutor 在接口中 TaskQueue<java.lang.Runnable>executor - executorCopyright © 2022 The Apache Software Foundation. All rights reserved.