yajsapi - JavaScript high-level API
Yagna Contributor Guide

Class: SmartQueue

yajsapi / Exports / executor/smartq / SmartQueue

Class: SmartQueue

executor/smartq.SmartQueue

Type parameters

Name

Item

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new SmartQueue(items, retry_cnt?, ...rest)

Type parameters

Name

Item

Parameters

Name

Type

Default value

items

Item[]

undefined

retry_cnt

number

2

...rest

any[]

undefined

Defined in

yajsapi/executor/smartq.ts:38

Properties

__done

Private __done: any

Defined in

yajsapi/executor/smartq.ts:38

__eof

Private __eof: any

Defined in

yajsapi/executor/smartq.ts:37

__new_items

Private __new_items: any

Defined in

yajsapi/executor/smartq.ts:36

_in_progress

Private _in_progress: Set<Handle>

Defined in

yajsapi/executor/smartq.ts:35

_items

Private _items: null | Item[]

Defined in

yajsapi/executor/smartq.ts:33

_rescheduled_items

Private _rescheduled_items: Set<Handle>

Defined in

yajsapi/executor/smartq.ts:34

Methods

__find_rescheduled_item

__find_rescheduled_item(consumer): null | Handle

Parameters

Name

Type

consumer

Consumer

Returns

null | Handle

Defined in

yajsapi/executor/smartq.ts:73

__have_data

__have_data(): boolean

Returns

boolean

Defined in

yajsapi/executor/smartq.ts:65

close

close(): void

Returns

void

Defined in

yajsapi/executor/smartq.ts:50

get

get(consumer, callback): AsyncGenerator<Handle, any, unknown>

Parameters

Name

Type

consumer

Consumer

callback

undefined | null | Function

Returns

AsyncGenerator<Handle, any, unknown>

Defined in

yajsapi/executor/smartq.ts:80

has_unassigned_items

has_unassigned_items(): boolean

Returns

boolean

Defined in

yajsapi/executor/smartq.ts:162

mark_done

mark_done(handle): Promise

Parameters

Name

Type

handle

Handle

Returns

Promise

Defined in

yajsapi/executor/smartq.ts:114

new_consumer

new_consumer(): Consumer

Returns

Consumer

Defined in

yajsapi/executor/smartq.ts:61

reschedule

reschedule(handle): Promise

Parameters

Name

Type

handle

Handle

Returns

Promise

Defined in

yajsapi/executor/smartq.ts:126

reschedule_all

reschedule_all(consumer): Promise

Parameters

Name

Type

consumer

Consumer

Returns

Promise

Defined in

yajsapi/executor/smartq.ts:134

stats

stats(): object

Returns

object

Defined in

yajsapi/executor/smartq.ts:148

wait_until_done

wait_until_done(): Promise

Returns

Promise

Defined in

yajsapi/executor/smartq.ts:156