Provides a process that dequeue from this queue.
Provides a process that dequeue from this queue. When multiple consumers dequeue from this queue, they dequeue in first-come, first-serve order.
Please use Topic
instead of Queue
when all subscribers
need to see each value enqueued.
This process is equivalent to dequeueBatch(1)
.
Equivalent to dequeueBatch with an infinite limit.
Equivalent to dequeueBatch with an infinite limit. Only use this
method if your underlying algebra (A
) has some sort of constant
time "natural batching"! If processing a chunk of size n is linearly
more expensive than processing a chunk of size 1, you should always
use dequeueBatch with some small limit, otherwise you will disrupt
fairness in the nondeterministic merge combinators.
Provides a process that dequeues in chunks.
Provides a process that dequeues in chunks. Whenever *n* elements
are available in the queue, min(n, limit)
elements will be dequeud
and produced as a single Seq
. Note that this naturally does not
*guarantee* that limit
items are returned in every chunk. If only
one element is available, that one element will be returned in its own
sequence. This method basically just allows a consumer to "catch up"
to a rapidly filling queue in the case where some sort of batching logic
is applicable.
A Sink
for enqueueing values to this Queue
.
Enqueue multiple A
values in this queue.
Enqueue multiple A
values in this queue. This has same semantics as sequencing
repeated calls to enqueueOne
.
Enqueue one element in this Queue
.
Enqueue one element in this Queue
. Resulting task will
terminate with failure if queue is closed or failed.
Please note this will get completed _after_ a
has been successfully enqueued.
A
to enqueue
The time-varying size of this Queue
.
The time-varying size of this Queue
. This signal refreshes
only when size changes. Offsetting enqueues and dequeues may
not result in refreshes.
The size bound on the queue.
The size bound on the queue. Returns None if the queue is unbounded.
Returns the available number of entries in the queue.
Returns the available number of entries in the queue.
Always returns Int.MaxValue
when the queue is unbounded.
Closes this queue.
Closes this queue. This halts the enqueue
Sink
and
dequeue
Process
after any already-queued elements are
drained.
After this any enqueue will fail with Terminated(End)
,
and the enqueue Sink
will terminate with End
.
Like kill
, except it terminates with supplied reason.
Returns true
when the queue has reached its upper size bound.
Returns true
when the queue has reached its upper size bound.
Always returns false
when the queue is unbounded.
Kills the queue.
Kills the queue. Unlike close
, this kills all dequeuers immediately.
Any subsequent enqueues will fail with Terminated(Kill)
.
The returned Task
will completed once all dequeuers and enqueuers
have been signalled.
Asynchronous queue interface. Operations are all nonblocking in their implementations, but may be 'semantically' blocking. For instance, a queue may have a bound on its size, in which case enqueuing may block until there is an offsetting dequeue.