类 TaskQueue<R extends Runnable>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<E>
-
- java.util.concurrent.LinkedBlockingQueue<Runnable>
-
- com.alibaba.dubbo.common.threadpool.support.eager.TaskQueue<R>
-
- 所有已实现的接口:
Serializable
,Iterable<Runnable>
,Collection<Runnable>
,BlockingQueue<Runnable>
,Queue<Runnable>
public class TaskQueue<R extends Runnable> extends LinkedBlockingQueue<Runnable>
TaskQueue in the EagerThreadPoolExecutor 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.- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 TaskQueue(int capacity)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
offer(Runnable runnable)
boolean
retryOffer(Runnable o, long timeout, TimeUnit unit)
retry offer taskvoid
setExecutor(EagerThreadPoolExecutor exec)
-
从类继承的方法 java.util.concurrent.LinkedBlockingQueue
clear, contains, drainTo, drainTo, forEach, iterator, offer, peek, poll, poll, put, remainingCapacity, remove, removeAll, removeIf, retainAll, size, spliterator, take, toArray, toArray, toString
-
从类继承的方法 java.util.AbstractQueue
add, addAll, element, remove
-
从类继承的方法 java.util.AbstractCollection
containsAll, isEmpty
-
从接口继承的方法 java.util.concurrent.BlockingQueue
add
-
从接口继承的方法 java.util.Collection
addAll, containsAll, equals, hashCode, isEmpty, parallelStream, stream, toArray
-
-
-
-
方法详细资料
-
setExecutor
public void setExecutor(EagerThreadPoolExecutor exec)
-
offer
public boolean offer(Runnable runnable)
-
retryOffer
public boolean retryOffer(Runnable o, long timeout, TimeUnit unit) throws InterruptedException
retry offer task- 参数:
o
- task- 返回:
- offer success or not
- 抛出:
RejectedExecutionException
- if executor is terminated.InterruptedException
-
-