Waits until the queue is shutdown.
Waits until the queue is shutdown.
The IO
returned by this method will not resume until the queue has been shutdown.
If the queue is already shutdown, the IO
will resume right away.
Places one value in the queue.
For Bounded Queue: uses the BackPressure
Strategy, places the values in the queue and returns always true
If the queue has reached capacity, then
the fiber performing the offerAll
will be suspended until there is room in
the queue.
For Bounded Queue: uses the BackPressure
Strategy, places the values in the queue and returns always true
If the queue has reached capacity, then
the fiber performing the offerAll
will be suspended until there is room in
the queue.
For Unbounded Queue: Places all values in the queue and returns true.
For Sliding Queue: uses Sliding
Strategy
If there is a room in the queue, it places the values and returns true otherwise it removed the old elements and
enqueues the new ones
For Dropping Queue: uses Dropping
Strategy,
It places the values in the queue but if there is no room it will not enqueue them and returns false
Interrupts any fibers that are suspended on offer
or take
.
Interrupts any fibers that are suspended on offer
or take
.
Future calls to offer*
and take*
will be interrupted immediately.
Retrieves the size of the queue, which is equal to the number of elements in the queue.
Retrieves the size of the queue, which is equal to the number of elements in the queue. This may be negative if fibers are suspended waiting for elements to be added to the queue.
Removes the oldest value in the queue.
Removes the oldest value in the queue. If the queue is empty, this will return a computation that resumes when an item has been added to the queue.
Removes all the values in the queue and returns the list of the values.
Removes all the values in the queue and returns the list of the values. If the queue is empty returns empty list.
Takes up to max number of values in the queue.
A
Queue[A]
is a lightweight, asynchronous queue for values of typeA
.