Skip to main content

@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

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

ParameterType
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

ParameterType
valueT

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

ParameterType
keystring
valunknown

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

ParameterType
keystring
valunknown

Returns

undefined | T

Source

packages/utils/dist/src/queue/index.d.ts:17


remove()

remove(id, keyForID?): void

Parameters

ParameterType
idstring
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

ParameterType
valueT

Returns

void

Source

packages/utils/dist/src/queue/index.d.ts:9