yajsapi - JavaScript high-level API
Yagna Contributor Guide

Class: Executor

yajsapi / Exports / executor / Executor

Class: Executor

executor.Executor

Task executor

description Used to run tasks using the specified application package within providers' execution units.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Executor(__namedParameters)

Create new executor

Parameters

Name

Type

__namedParameters

ExecutorOpts

Defined in

yajsapi/executor/index.ts:168

Properties

_active_computations

Private _active_computations: any

Defined in

yajsapi/executor/index.ts:166

_activity_api

Private _activity_api: any

Defined in

yajsapi/executor/index.ts:161

_api_config

Private _api_config: any

Defined in

yajsapi/executor/index.ts:151

_budget_allocations

Private _budget_allocations: Allocation[]

Defined in

yajsapi/executor/index.ts:157

_budget_amount

Private _budget_amount: any

Defined in

yajsapi/executor/index.ts:156

_cancellation_token

Private _cancellation_token: default

Defined in

yajsapi/executor/index.ts:168

_chan_computation_done

Private _chan_computation_done: any

Defined in

yajsapi/executor/index.ts:167

_conf

Private _conf: any

Defined in

yajsapi/executor/index.ts:154

_driver

Private _driver: any

Defined in

yajsapi/executor/index.ts:147

_expires

Private _expires: any

Defined in

yajsapi/executor/index.ts:155

_market_api

Private _market_api: any

Defined in

yajsapi/executor/index.ts:162

_network

Private _network: any

Defined in

yajsapi/executor/index.ts:148

_payment_api

Private _payment_api: any

Defined in

yajsapi/executor/index.ts:163

_stack

Private _stack: any

Defined in

yajsapi/executor/index.ts:152

_strategy

Private _strategy: any

Defined in

yajsapi/executor/index.ts:150

_stream_output

Private _stream_output: any

Defined in

yajsapi/executor/index.ts:149

_subnet

Private _subnet: any

Defined in

yajsapi/executor/index.ts:146

_task_package

Private _task_package: any

Defined in

yajsapi/executor/index.ts:153

_wrapped_consumer

Private _wrapped_consumer: any

Defined in

yajsapi/executor/index.ts:165

state

Private Optional state: SubmissionState

Defined in

yajsapi/executor/index.ts:159

Methods

_create_allocations

_create_allocations(): Promise

Returns

Promise

Defined in

yajsapi/executor/index.ts:843

_get_allocation

_get_allocation(item): Allocation

Parameters

Name

Type

item

Invoice | DebitNote

Returns

Allocation

Defined in

yajsapi/executor/index.ts:894

_get_common_payment_platforms

_get_common_payment_platforms(proposal): string[]

Parameters

Name

Type

proposal

OfferProposal

Returns

string[]

Defined in

yajsapi/executor/index.ts:875

_handle_proposal

_handle_proposal(state, proposal): Promise<ProposalEvent>

Parameters

Name

Type

state

SubmissionState

proposal

OfferProposal

Returns

Promise<ProposalEvent>

Defined in

yajsapi/executor/index.ts:265

_submit

_submit(worker, data): AsyncGenerator<Task<"D", "R">, any, unknown>

Parameters

Name

Type

worker

default<[WorkContext, AsyncIterable<Task<"D", "R">>], AsyncGenerator>

data

Iterable<Task<"D", "R">>

Returns

AsyncGenerator<Task<"D", "R">, any, unknown>

Defined in

yajsapi/executor/index.ts:371

done

done(): Promise

Returns

Promise

Defined in

yajsapi/executor/index.ts:926

find_offers

find_offers(state, emit): Promise

Parameters

Name

Type

state

SubmissionState

emit

default<[YaEvent], void>

Returns

Promise

Defined in

yajsapi/executor/index.ts:347

find_offers_for_subscription

find_offers_for_subscription(state, subscription, emit): Promise

Parameters

Name

Type

state

SubmissionState

subscription

Subscription

emit

default<[YaEvent], void>

Returns

Promise

Defined in

yajsapi/executor/index.ts:310

ready

ready(): Promise<Executor>

Returns

Promise<Executor>

Defined in

yajsapi/executor/index.ts:908

submit

submit(worker, data): AsyncGenerator<Task<"D", "R">, any, unknown>

Submit a computation to be executed on providers.

Parameters

Name

Type

Description

worker

default<[WorkContext, AsyncIterable<Task<"D", "R">>], AsyncGenerator>

a callable that takes a WorkContext object and a list o tasks, adds commands to the context object and yields committed commands

data

Iterable<Task<"D", "R">>

an iterator of Task objects to be computed on providers

Returns

AsyncGenerator<Task<"D", "R">, any, unknown>

yields computation progress events

Defined in

yajsapi/executor/index.ts:247