TPriorityQueue

zio.stm.TPriorityQueue
See theTPriorityQueue companion object
final class TPriorityQueue[A] extends AnyVal

A TPriorityQueue contains values of type A that an Ordering is defined on. Unlike a TQueue, take returns the highest priority value (the value that is first in the specified ordering) as opposed to the first value offered to the queue. The ordering that elements with the same priority will be taken from the queue is not guaranteed.

Attributes

Companion:
object
Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

Checks whether the queue is empty.

Checks whether the queue is empty.

Attributes

Checks whether the queue is not empty..

Checks whether the queue is not empty..

Attributes

def offer(a: A): USTM[Unit]

Offers the specified value to the queue.

Offers the specified value to the queue.

Attributes

def offerAll(values: Iterable[A]): USTM[Unit]

Offers all of the elements in the specified collection to the queue.

Offers all of the elements in the specified collection to the queue.

Attributes

def peek: USTM[A]

Peeks at the first value in the queue without removing it, retrying until a value is in the queue.

Peeks at the first value in the queue without removing it, retrying until a value is in the queue.

Attributes

Peeks at the first value in the queue without removing it, returning None if there is not a value in the queue.

Peeks at the first value in the queue without removing it, returning None if there is not a value in the queue.

Attributes

def removeIf(f: A => Boolean): USTM[Unit]

Removes all elements from the queue matching the specified predicate.

Removes all elements from the queue matching the specified predicate.

Attributes

def retainIf(f: A => Boolean): USTM[Unit]

Retains only elements from the queue matching the specified predicate.

Retains only elements from the queue matching the specified predicate.

Attributes

def size: USTM[Int]

Returns the size of the queue.

Returns the size of the queue.

Attributes

def take: USTM[A]

Takes a value from the queue, retrying until a value is in the queue.

Takes a value from the queue, retrying until a value is in the queue.

Attributes

def takeAll: USTM[Chunk[A]]

Takes all values from the queue.

Takes all values from the queue.

Attributes

Takes a value from the queue, returning None if there is not a value in the queue.

Takes a value from the queue, returning None if there is not a value in the queue.

Attributes

def takeUpTo(n: Int): USTM[Chunk[A]]

Takes up to the specified maximum number of elements from the queue.

Takes up to the specified maximum number of elements from the queue.

Attributes

def toChunk: USTM[Chunk[A]]

Collects all values into a chunk.

Collects all values into a chunk.

Attributes

def toList: USTM[List[A]]

Collects all values into a list.

Collects all values into a list.

Attributes

Collects all values into a vector.

Collects all values into a vector.

Attributes