TPriorityQueue
Constructors
Signature
declare const empty: <A>(order: Order.Order<A>) => STM.STM<TPriorityQueue<A>>;fromIterable
Creates a new TPriorityQueue from an iterable collection of values.
Signature
declare const fromIterable: <A>(
order: Order.Order<A>,
) => (iterable: Iterable<A>) => STM.STM<TPriorityQueue<A>>;Makes a new TPriorityQueue that is initialized with specified values.
Signature
declare const make: <A>(
order: Order.Order<A>,
) => (...elements: Array<A>) => STM.STM<TPriorityQueue<A>>;Destructors
Collects all values into an array.
Signature
declare const toArray: <A>(self: TPriorityQueue<A>) => STM.STM<Array<A>>;Collects all values into a Chunk.
Signature
declare const toChunk: <A>(self: TPriorityQueue<A>) => STM.STM<Chunk.Chunk<A>>;Getters
Checks whether the queue is empty.
Signature
declare const isEmpty: <A>(self: TPriorityQueue<A>) => STM.STM<boolean>;isNonEmpty
Checks whether the queue is not empty.
Signature
declare const isNonEmpty: <A>(self: TPriorityQueue<A>) => STM.STM<boolean>;Peeks at the first value in the queue without removing it, retrying until a value is in the queue.
Signature
declare const peek: <A>(self: TPriorityQueue<A>) => STM.STM<A>;peekOption
Peeks at the first value in the queue without removing it, returning None if there is not a value in the queue.
Signature
declare const peekOption: <A>(self: TPriorityQueue<A>) => STM.STM<Option.Option<A>>;Removes all elements from the queue matching the specified predicate.
Signature
declare const removeIf: {
<A>(predicate: Predicate<A>): (self: TPriorityQueue<A>) => STM<void>;
<A>(self: TPriorityQueue<A>, predicate: Predicate<A>): STM<void>;
};Retains only elements from the queue matching the specified predicate.
Signature
declare const retainIf: {
<A>(predicate: Predicate<A>): (self: TPriorityQueue<A>) => STM<void>;
<A>(self: TPriorityQueue<A>, predicate: Predicate<A>): STM<void>;
};Returns the size of the queue.
Signature
declare const size: <A>(self: TPriorityQueue<A>) => STM.STM<number>;Models
TPriorityQueue interface
A TPriorityQueue contains values of type A that an Order 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.
Signature
interface TPriorityQueue<in out A> extends Variance<A> {}Mutations
Offers the specified value to the queue.
Signature
declare const offer: {
<A>(value: A): (self: TPriorityQueue<A>) => STM<void>;
<A>(self: TPriorityQueue<A>, value: A): STM<void>;
};Offers all of the elements in the specified collection to the queue.
Signature
declare const offerAll: {
<A>(values: Iterable<A>): (self: TPriorityQueue<A>) => STM<void>;
<A>(self: TPriorityQueue<A>, values: Iterable<A>): STM<void>;
};Takes a value from the queue, retrying until a value is in the queue.
Signature
declare const take: <A>(self: TPriorityQueue<A>) => STM.STM<A>;Takes all values from the queue.
Signature
declare const takeAll: <A>(self: TPriorityQueue<A>) => STM.STM<Array<A>>;takeOption
Takes a value from the queue, returning None if there is not a value in the queue.
Signature
declare const takeOption: <A>(self: TPriorityQueue<A>) => STM.STM<Option.Option<A>>;Takes up to the specified maximum number of elements from the queue.
Signature
declare const takeUpTo: {
(n: number): <A>(self: TPriorityQueue<A>) => STM<Array<A>>;
<A>(self: TPriorityQueue<A>, n: number): STM<Array<A>>;
};Other
TPriorityQueue
Symbols
TPriorityQueueTypeId
Signature
declare const TPriorityQueueTypeId: unique symbol;TPriorityQueueTypeId type
Signature
type TPriorityQueueTypeId = typeof TPriorityQueueTypeId;
Constructs a new empty
TPriorityQueuewith the specifiedOrder.