Skip to content

Latest commit

 

History

History
274 lines (154 loc) · 6.58 KB

executor_agreements_pool.agreementspool.md

File metadata and controls

274 lines (154 loc) · 6.58 KB

Class: AgreementsPool

yajsapi / Exports / executor/agreements_pool / AgreementsPool

Class: AgreementsPool

executor/agreements_pool.AgreementsPool

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new AgreementsPool(emitter)

Parameters

Name Type
emitter any

Defined in

yajsapi/executor/agreements_pool.ts:38

Properties

_agreements

Private _agreements: Map

Defined in

yajsapi/executor/agreements_pool.ts:34

_confirmed

Private _confirmed: number = 0

Defined in

yajsapi/executor/agreements_pool.ts:37

_lock

Private _lock: Lock

Defined in

yajsapi/executor/agreements_pool.ts:35

_offer_buffer

Private _offer_buffer: Map

Defined in

yajsapi/executor/agreements_pool.ts:33

_rejecting_providers

Private _rejecting_providers: Set

Defined in

yajsapi/executor/agreements_pool.ts:36

cancellation_token

Optional cancellation_token: default

Defined in

yajsapi/executor/agreements_pool.ts:38

emitter

Private emitter: any

Defined in

yajsapi/executor/agreements_pool.ts:32

Methods

_get_agreement

Private _get_agreement(): Promise

Returns

Promise

Defined in

yajsapi/executor/agreements_pool.ts:75

_set_worker

_set_worker(agreement_id, task): Promise

Parameters

Name Type
agreement_id string
task any

Returns

Promise

Defined in

yajsapi/executor/agreements_pool.ts:69

_terminate_agreement

Private _terminate_agreement(agreement_id, reason): Promise

Parameters

Name Type
agreement_id string
reason object

Returns

Promise

Defined in

yajsapi/executor/agreements_pool.ts:156

add_proposal

add_proposal(score, proposal): Promise

Parameters

Name Type
score number
proposal OfferProposal

Returns

Promise

Defined in

yajsapi/executor/agreements_pool.ts:53

cycle

cycle(): Promise

Returns

Promise

Defined in

yajsapi/executor/agreements_pool.ts:42

rejected_last_agreement

rejected_last_agreement(provider_id): boolean

Parameters

Name Type
provider_id string

Returns

boolean

Implementation of

ComputationHistory.rejected_last_agreement

Defined in

yajsapi/executor/agreements_pool.ts:187

release_agreement

release_agreement(agreement_id, allow_reuse?): Promise

Parameters

Name Type Default value
agreement_id string undefined
allow_reuse boolean true

Returns

Promise

Defined in

yajsapi/executor/agreements_pool.ts:144

terminate_all

terminate_all(reason): Promise

Parameters

Name Type
reason object

Returns

Promise

Defined in

yajsapi/executor/agreements_pool.ts:180

use_agreement

use_agreement(cbk): Promise

Parameters

Name Type
cbk any

Returns

Promise

Defined in

yajsapi/executor/agreements_pool.ts:58