@terascope/job-components / index / Queue
Class: Queue<T>
A basic FIFO queue
Type parameters
Type parameter |
---|
T |
Constructors
new Queue()
new Queue<
T
>():Queue
<T
>
Returns
Queue
<T
>
Properties
head?
optional
head:default
<T
>
Source
packages/utils/dist/src/queue/index.d.ts:4
tail?
optional
tail:default
<T
>
Source
packages/utils/dist/src/queue/index.d.ts:5
Methods
dequeue()
dequeue():
undefined
|T
Returns
undefined
| T
Source
packages/utils/dist/src/queue/index.d.ts:10
each()
each(
fn
):void
Iterate over each value
Parameters
Parameter | Type |
---|---|
fn | (value ) => void |
Returns
void
Source
packages/utils/dist/src/queue/index.d.ts:12
enqueue()
enqueue(
value
):void
A value to the end of the queue
Parameters
Parameter | Type |
---|---|
value | T |
Returns
void
Source
packages/utils/dist/src/queue/index.d.ts:8
exists()
exists(
key
,val
):boolean
Search the queue to see if a key value pair exists
Parameters
Parameter | Type |
---|---|
key | string |
val | unknown |
Returns
boolean
Source
packages/utils/dist/src/queue/index.d.ts:25
extract()
extract(
key
,val
):undefined
|T
Search the queue for a key that matches a value and return the match
Parameters
Parameter | Type |
---|---|
key | string |
val | unknown |
Returns
undefined
| T
Source
packages/utils/dist/src/queue/index.d.ts:17
remove()
remove(
id
,keyForID
?):void
Parameters
Parameter | Type |
---|---|
id | string |
keyForID ? | string |
Returns
void
Source
packages/utils/dist/src/queue/index.d.ts:13
size()
size():
number
Get the length of the queue
Returns
number
Source
packages/utils/dist/src/queue/index.d.ts:21
unshift()
unshift(
value
):void
Parameters
Parameter | Type |
---|---|
value | T |
Returns
void
Source
packages/utils/dist/src/queue/index.d.ts:9