public interface TaskQueue<E>
extends java.util.concurrent.BlockingQueue<E>
| Modifier and Type | Method and Description |
|---|---|
boolean |
doOffer(E e)
offer element to the queue.
|
EagerExecutorService |
getExecutor()
get executor.
|
default boolean |
offer(E e) |
default boolean |
retryOffer(E o,
long timeout,
java.util.concurrent.TimeUnit unit)
retry offer task.
|
void |
setExecutor(EagerExecutorService executor)
set the executor.
|
add, contains, drainTo, drainTo, offer, poll, put, remainingCapacity, remove, takeEagerExecutorService getExecutor()
void setExecutor(EagerExecutorService executor)
executor - executordefault boolean offer(E e)
boolean doOffer(E e)
e - the element to addtrue if the element was added to this queue, else falsedefault boolean retryOffer(E o, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
o - tasktimeout - timeoutunit - timeout unitjava.util.concurrent.RejectedExecutionException - if executor is terminated.java.lang.InterruptedException - if the current thread is interrupted.Copyright © 2024 The Apache Software Foundation. All rights reserved.