Queue

zio.Queue$
See theQueue companion class
object Queue

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Queue.type

Members list

Concise view

Value members

Concrete methods

def bounded[A](requestedCapacity: => Int)(implicit trace: Trace): UIO[Queue[A]]

Makes a new bounded queue. When the capacity of the queue is reached, any additional calls to offer will be suspended until there is more room in the queue.

Makes a new bounded queue. When the capacity of the queue is reached, any additional calls to offer will be suspended until there is more room in the queue.

Attributes

A

type of the Queue

requestedCapacity

capacity of the Queue

Returns:

UIO[Queue[A]]

Note:

when possible use only power of 2 capacities; this will provide better performance by utilising an optimised version of the underlying zio.internal.RingBuffer.

def dropping[A](requestedCapacity: => Int)(implicit trace: Trace): UIO[Queue[A]]

Makes a new bounded queue with the dropping strategy. When the capacity of the queue is reached, new elements will be dropped.

Makes a new bounded queue with the dropping strategy. When the capacity of the queue is reached, new elements will be dropped.

Attributes

A

type of the Queue

requestedCapacity

capacity of the Queue

Returns:

UIO[Queue[A]]

Note:

when possible use only power of 2 capacities; this will provide better performance by utilising an optimised version of the underlying zio.internal.RingBuffer.

def sliding[A](requestedCapacity: => Int)(implicit trace: Trace): UIO[Queue[A]]

Makes a new bounded queue with sliding strategy. When the capacity of the queue is reached, new elements will be added and the old elements will be dropped.

Makes a new bounded queue with sliding strategy. When the capacity of the queue is reached, new elements will be added and the old elements will be dropped.

Attributes

A

type of the Queue

requestedCapacity

capacity of the Queue

Returns:

UIO[Queue[A]]

Note:

when possible use only power of 2 capacities; this will provide better performance by utilising an optimised version of the underlying zio.internal.RingBuffer.

def unbounded[A](implicit trace: Trace): UIO[Queue[A]]

Makes a new unbounded queue.

Makes a new unbounded queue.

Attributes

A

type of the Queue

Returns:

UIO[Queue[A]]