api/classes/queue
Globals / Queue
Class: Queue<A>
Queue Data Structure
Type parameters
Name | Default |
---|---|
A | never |
Hierarchy
- Queue
Index
Properties
Accessors
Methods
Properties
capacity
• Readonly
capacity: number
Defined in packages/core/lib/main/Queue.ts:45
Accessors
asArray
• get asArray(): QIO<A[]>
Defined in packages/core/lib/main/Queue.ts:49
Returns the Queue as an array
Returns: QIO<A[]>
length
• get length(): QIO<number>
Defined in packages/core/lib/main/Queue.ts:55
Returns the number of elements in the queue
Returns: QIO<number>
take
• get take(): QIO<A>
Defined in packages/core/lib/main/Queue.ts:61
Pulls an item from the queue
Returns: QIO<A>
waitForSpace
• get waitForSpace(): QIO<boolean>
Defined in packages/core/lib/main/Queue.ts:81
Returns: QIO<boolean>
Methods
offer
▸ offer(a
: A): QIO<void>
Defined in packages/core/lib/main/Queue.ts:98
Inserts an item into the queue
Parameters:
Name | Type |
---|---|
a | A |
Returns: QIO<void>
offerAll
▸ offerAll(...a
: A[]): QIO<void>
Defined in packages/core/lib/main/Queue.ts:116
Adds all the provided items into the queue
Parameters:
Name | Type |
---|---|
...a | A[] |
Returns: QIO<void>
takeN
▸ takeN(n
: number): QIO<A[]>
Defined in packages/core/lib/main/Queue.ts:122
Resolves after n
items are available in the queue.
Parameters:
Name | Type |
---|---|
n | number |
Returns: QIO<A[]>
bounded
▸ Static
bounded<A>(capacity
: number): QIO<Queue<A>>
Defined in packages/core/lib/main/Queue.ts:32
Creates a new bounded Queue
Type parameters:
Name |
---|
A |
Parameters:
Name | Type |
---|---|
capacity | number |
unbounded
▸ Static
unbounded<A>(): QIO<Queue<A>>
Defined in packages/core/lib/main/Queue.ts:38
Creates a queue which is theoretically unbounded.
Type parameters:
Name |
---|
A |