public class MemoryLimitedTaskQueue<R extends java.lang.Runnable> extends MemoryLimitedLinkedBlockingQueue<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.| 构造器和说明 |
|---|
MemoryLimitedTaskQueue(java.lang.instrument.Instrumentation inst) |
MemoryLimitedTaskQueue(long memoryLimit,
java.lang.instrument.Instrumentation inst) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
doOffer(java.lang.Runnable runnable)
offer element to the queue.
|
EagerExecutorService |
getExecutor()
get executor.
|
void |
setExecutor(EagerExecutorService executor)
set the executor.
|
clear, getCurrentMemory, getCurrentRemainMemory, getMemoryLimit, offer, offer, poll, poll, put, remove, setMemoryLimit, takecontains, drainTo, drainTo, iterator, peek, remainingCapacity, size, spliterator, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitoffer, retryOfferadd, contains, drainTo, drainTo, offer, poll, put, remainingCapacity, remove, takepublic MemoryLimitedTaskQueue(java.lang.instrument.Instrumentation inst)
public MemoryLimitedTaskQueue(long memoryLimit,
java.lang.instrument.Instrumentation inst)
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.