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.

Hierarchy

  • Executor

Table of contents

Constructors

Properties

Methods

Constructors

constructor

Create new executor

Parameters:

__namedParameters: ExecutorOpts

Returns: Executor

Defined in: yajsapi/executor/index.ts:139

Properties

_activity_api

Private _activity_api: any

Defined in: yajsapi/executor/index.ts:133

_api_config

Private _api_config: any

Defined in: yajsapi/executor/index.ts:125

_budget_allocations

Private _budget_allocations: Allocation[]

Defined in: yajsapi/executor/index.ts:131

_budget_amount

Private _budget_amount: any

Defined in: yajsapi/executor/index.ts:130

_cancellation_token

Private _cancellation_token: default

Defined in: yajsapi/executor/index.ts:138

_conf

Private _conf: any

Defined in: yajsapi/executor/index.ts:128

_driver

Private _driver: any

Defined in: yajsapi/executor/index.ts:121

_expires

Private _expires: any

Defined in: yajsapi/executor/index.ts:129

_market_api

Private _market_api: any

Defined in: yajsapi/executor/index.ts:134

_network

Private _network: any

Defined in: yajsapi/executor/index.ts:122

_payment_api

Private _payment_api: any

Defined in: yajsapi/executor/index.ts:135

_stack

Private _stack: any

Defined in: yajsapi/executor/index.ts:126

_strategy

Private _strategy: any

Defined in: yajsapi/executor/index.ts:124

_stream_output

Private _stream_output: any

Defined in: yajsapi/executor/index.ts:123

_subnet

Private _subnet: any

Defined in: yajsapi/executor/index.ts:120

_task_package

Private _task_package: any

Defined in: yajsapi/executor/index.ts:127

_worker_cancellation_token

Private _worker_cancellation_token: default

Defined in: yajsapi/executor/index.ts:139

_wrapped_consumer

Private _wrapped_consumer: any

Defined in: yajsapi/executor/index.ts:137

Methods

_create_allocations

_create_allocations(): Promise

Returns: Promise

Defined in: yajsapi/executor/index.ts:811

_get_allocation

_get_allocation(item: Invoice | DebitNote): Allocation

Parameters:

Name

Type

item

Invoice | DebitNote

Returns: Allocation

Defined in: yajsapi/executor/index.ts:862

_get_common_payment_platforms

_get_common_payment_platforms(proposal: OfferProposal): string[]

Parameters:

Name

Type

proposal

OfferProposal

Returns: string[]

Defined in: yajsapi/executor/index.ts:843

done

done(): Promise<void>

Returns: Promise<void>

Defined in: yajsapi/executor/index.ts:894

ready

ready(): Promise<Executor>

Returns: Promise<Executor>

Defined in: yajsapi/executor/index.ts:876

submit

submit(worker: default<[WorkContext, AsyncIterable<Task<D, R>>], AsyncGenerator<Work, any, unknown>>, data: Iterable<Task<D, R>>): 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<Work, any, unknown>>

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:213