Dequeue

zio.Dequeue
trait Dequeue[+A] extends Serializable

A queue that can only be dequeued.

Attributes

Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
class Queue[A]

Members list

Value members

Abstract methods

def awaitShutdown(implicit trace: Trace): UIO[Unit]

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.

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.

Attributes

def capacity: Int

How many elements can hold in the queue

How many elements can hold in the queue

Attributes

def isShutdown(implicit trace: Trace): UIO[Boolean]

true if shutdown has been called.

true if shutdown has been called.

Attributes

def shutdown(implicit trace: Trace): UIO[Unit]

Interrupts any fibers that are suspended on offer or take. Future calls to offer* and take* will be interrupted immediately.

Interrupts any fibers that are suspended on offer or take. Future calls to offer* and take* will be interrupted immediately.

Attributes

def size(implicit trace: Trace): UIO[Int]

Retrieves the size of the queue. This may be negative if fibers are suspended waiting for elements to be added to the queue or greater than the capacity if fibers are suspended waiting to add elements to the queue.

Retrieves the size of the queue. This may be negative if fibers are suspended waiting for elements to be added to the queue or greater than the capacity if fibers are suspended waiting to add elements to the queue.

Attributes

def take(implicit trace: Trace): UIO[A]

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 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.

Attributes

def takeAll(implicit trace: Trace): UIO[Chunk[A]]

Removes all the values in the queue and returns the values. If the queue is empty returns an empty collection.

Removes all the values in the queue and returns the values. If the queue is empty returns an empty collection.

Attributes

def takeUpTo(max: Int)(implicit trace: Trace): UIO[Chunk[A]]

Takes up to max number of values in the queue.

Takes up to max number of values in the queue.

Attributes

Concrete methods

def isEmpty(implicit trace: Trace): UIO[Boolean]

Checks whether the queue is currently empty.

Checks whether the queue is currently empty.

Attributes

def isFull(implicit trace: Trace): UIO[Boolean]

Checks whether the queue is currently full.

Checks whether the queue is currently full.

Attributes

final def poll(implicit trace: Trace): UIO[Option[A]]

Take the head option of values in the queue.

Take the head option of values in the queue.

Attributes

final def takeBetween(min: Int, max: Int)(implicit trace: Trace): UIO[Chunk[A]]

Takes a number of elements from the queue between the specified minimum and maximum. If there are fewer than the minimum number of elements available, suspends until at least the minimum number of elements have been collected.

Takes a number of elements from the queue between the specified minimum and maximum. If there are fewer than the minimum number of elements available, suspends until at least the minimum number of elements have been collected.

Attributes

final def takeN(n: Int)(implicit trace: Trace): UIO[Chunk[A]]

Takes the specified number of elements from the queue. If there are fewer than the specified number of elements available, it suspends until they become available.

Takes the specified number of elements from the queue. If there are fewer than the specified number of elements available, it suspends until they become available.

Attributes