public class TaskQueue<R extends Runnable> extends LinkedBlockingQueue<Runnable>
| 构造器和说明 |
|---|
TaskQueue(int capacity) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
offer(Runnable runnable) |
boolean |
retryOffer(Runnable runnable,
long timeout,
TimeUnit unit)
Retry offer.
|
clear, contains, drainTo, drainTo, iterator, offer, peek, poll, poll, put, remainingCapacity, remove, size, spliterator, take, toArray, toArray, toStringadd, addAll, element, removecontainsAll, isEmpty, removeAll, retainAllclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddaddAll, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, streampublic boolean offer(Runnable runnable)
offer 在接口中 BlockingQueue<Runnable>offer 在接口中 Queue<Runnable>offer 在类中 LinkedBlockingQueue<Runnable>public boolean retryOffer(Runnable runnable, long timeout, TimeUnit unit) throws InterruptedException
runnable - submit thread pool tasktimeout - how long to wait before giving up, in units of
unitunit - a TimeUnit determining how to interpret the
timeout parameterInterruptedExceptionCopyright © 2022. All rights reserved.