public interface AsyncDistributedQueue<E> extends AsyncDistributedCollection<E>
DEFAULT_OPERATION_TIMEOUT_MILLIS| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Boolean> |
add(E e)
Inserts the specified element into this queue if it is possible to do so
immediately without violating capacity restrictions, returning
true upon success and throwing an IllegalStateException
if no space is currently available. |
CompletableFuture<E> |
element()
Retrieves, but does not remove, the head of this queue.
|
CompletableFuture<Boolean> |
offer(E e)
Inserts the specified element into this queue if it is possible to do
so immediately without violating capacity restrictions.
|
CompletableFuture<E> |
peek()
Retrieves, but does not remove, the head of this queue,
or returns
null if this queue is empty. |
CompletableFuture<E> |
poll()
Retrieves and removes the head of this queue,
or returns
null if this queue is empty. |
CompletableFuture<E> |
remove()
Retrieves and removes the head of this queue.
|
default DistributedQueue<E> |
sync()
Returns a synchronous wrapper around the asynchronous primitive.
|
DistributedQueue<E> |
sync(Duration operationTimeout)
Returns a synchronous wrapper around the asynchronous primitive.
|
addAll, addListener, addListener, clear, contains, containsAll, isEmpty, remove, removeAll, removeListener, retainAll, sizeclose, deleteaddStateChangeListener, name, protocol, removeStateChangeListener, typeiterator, streamCompletableFuture<Boolean> add(E e)
true upon success and throwing an IllegalStateException
if no space is currently available.add in interface AsyncDistributedCollection<E>e - the element to addtrue (as specified by Collection.add(E))IllegalStateException - if the element cannot be added at this
time due to capacity restrictionsClassCastException - if the class of the specified element
prevents it from being added to this queueNullPointerException - if the specified element is null and
this queue does not permit null elementsIllegalArgumentException - if some property of this element
prevents it from being added to this queueCompletableFuture<Boolean> offer(E e)
add(E), which can fail to insert an element only
by throwing an exception.e - the element to addtrue if the element was added to this queue, else
falseClassCastException - if the class of the specified element
prevents it from being added to this queueNullPointerException - if the specified element is null and
this queue does not permit null elementsIllegalArgumentException - if some property of this element
prevents it from being added to this queueCompletableFuture<E> remove()
poll only in that it throws an exception if this
queue is empty.NoSuchElementException - if this queue is emptyCompletableFuture<E> poll()
null if this queue is empty.null if this queue is emptyCompletableFuture<E> element()
peek only in that it throws an exception
if this queue is empty.NoSuchElementException - if this queue is emptyCompletableFuture<E> peek()
null if this queue is empty.null if this queue is emptydefault DistributedQueue<E> sync()
AsyncPrimitivesync in interface AsyncDistributedCollection<E>sync in interface AsyncPrimitiveDistributedQueue<E> sync(Duration operationTimeout)
AsyncPrimitivesync in interface AsyncDistributedCollection<E>sync in interface AsyncPrimitiveoperationTimeout - the synchronous operation timeoutCopyright © 2013–2018. All rights reserved.