reference

Class: Job<Output>

job/job.Job

State of a computation unit.

Description

Represents the state of some computation unit. The purpose of this class is to provide a way to check the state, results and error of a computation unit knowing only its id.

Type parameters

NameType
Outputunknown

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Job<Output>(id, jobStorage)

Type parameters

NameType
Outputunknown

Parameters

NameType
idstring
jobStorageJobStorage

Defined in

src/job/job.ts:10

Properties

id

Readonly id: string

Defined in

src/job/job.ts:11

Methods

saveInitialState

saveInitialState(): Promise<void>

Returns

Promise<void>

Defined in

src/job/job.ts:15


saveState

saveState(state, results?, error?): Promise<void>

Parameters

NameType
stateTaskState
results?Output
error?Error

Returns

Promise<void>

Defined in

src/job/job.ts:19


fetchState

fetchState(): Promise<TaskState>

Returns

Promise<TaskState>

Defined in

src/job/job.ts:31


fetchResults

fetchResults(): Promise<undefined | Output>

Returns

Promise<undefined | Output>

Defined in

src/job/job.ts:35


fetchError

fetchError(): Promise<undefined | Error>

Returns

Promise<undefined | Error>

Defined in

src/job/job.ts:39