An asynchronous, unbounded, FIFO queue.
optional limit on the number of pending offers
.
The default is unbounded, but any other positive value can be used to limit
the max queue size. Note that Int.MaxValue
is used to denote unbounded.
Drains any pending elements into a Try[Queue]
.
Drains any pending elements into a Try[Queue]
.
If the queue has been failed and is now empty,
a Throw
of the exception used to fail will be returned.
Otherwise, return a Return(Queue)
of the pending elements.
Fail the queue.
Fail the queue. When discard
is true, the queue contents is discarded
and all pollers are failed immediately. When this flag is false, subsequent
pollers are not failed until the queue becomes empty.
No new elements are admitted to the queue after it has been failed.
Fail the queue: current and subsequent pollers will be completed with the given exception; any outstanding messages are discarded.
Insert the given element at the tail of the queue.
Insert the given element at the tail of the queue.
true
if the item was successfully added, false
otherwise.
Retrieves and removes the head of the queue, completing the returned future when the element is available.
Retrieves and removes the head of the queue, completing the returned future when the element is available.
Returns the current number of pending elements.
An asynchronous FIFO queue. In addition to providing offer and poll, the queue can be "failed", flushing current pollers.