JS Task API Reference

Class: Task<OutputType>

task.Task

One computation unit.

Description

Represents one computation unit that will be run on the one provider machine (e.g. rendering of one frame of an animation).

Type parameters

NameType
OutputTypeunknown

Implements

  • QueueableTask

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Task<OutputType>(id, taskFunction, options?)

Type parameters

NameType
OutputTypeunknown

Parameters

NameType
idstring
taskFunctionTaskFunction<OutputType>
options?TaskOptions

Defined in

task.ts:72

Properties

retryOnTimeout

Readonly retryOnTimeout: boolean

Defined in

task.ts:62


id

Readonly id: string

Implementation of

QueueableTask.id

Defined in

task.ts:73

Methods

onStateChange

onStateChange(listener): void

Parameters

NameType
listener(state: TaskState) => void

Returns

void

Defined in

task.ts:86


cleanup

cleanup(): void

Returns

void

Defined in

task.ts:89


init

init(): void

Returns

void

Defined in

task.ts:93


start

start(resourceRental, exe): void

Parameters

NameType
resourceRentalResourceRental
exeExeUnit

Returns

void

Defined in

task.ts:110


stop

stop(results?, error?, retry?): void

Parameters

NameTypeDefault value
results?OutputTypeundefined
error?Errorundefined
retrybooleantrue

Returns

void

Defined in

task.ts:125


isQueueable

isQueueable(): boolean

Returns

boolean

Implementation of

QueueableTask.isQueueable

Defined in

task.ts:145


isRetry

isRetry(): boolean

Returns

boolean

Defined in

task.ts:148


isDone

isDone(): boolean

Returns

boolean

Defined in

task.ts:151


isFinished

isFinished(): boolean

Returns

boolean

Defined in

task.ts:154


isRejected

isRejected(): boolean

Returns

boolean

Defined in

task.ts:157


isQueued

isQueued(): boolean

Returns

boolean

Defined in

task.ts:160


isPending

isPending(): boolean

Returns

boolean

Defined in

task.ts:163


isNew

isNew(): boolean

Returns

boolean

Defined in

task.ts:166


isFailed

isFailed(): boolean

Returns

boolean

Defined in

task.ts:169


getResults

getResults(): undefined | OutputType

Returns

undefined | OutputType

Defined in

task.ts:172


getTaskFunction

getTaskFunction(): TaskFunction<OutputType>

Returns

TaskFunction<OutputType>

Defined in

task.ts:175


getRetriesCount

getRetriesCount(): number

Returns

number

Defined in

task.ts:178


getError

getError(): undefined | Error

Returns

undefined | Error

Defined in

task.ts:181


getResourceRental

getResourceRental(): undefined | ResourceRental

Returns

undefined | ResourceRental

Defined in

task.ts:184


getExeUnit

getExeUnit(): undefined | ExeUnit

Returns

undefined | ExeUnit

Defined in

task.ts:187


getState

getState(): TaskState

Returns

TaskState

Defined in

task.ts:190


getDetails

getDetails(): TaskDetails

Returns

TaskDetails

Defined in

task.ts:199

Was this helpful?