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
Name | Type |
---|---|
OutputType | unknown |
Implements
QueueableTask
Table of contents
Constructors
Properties
Methods
- onStateChange
- cleanup
- init
- start
- stop
- isQueueable
- isRetry
- isDone
- isFinished
- isRejected
- isQueued
- isPending
- isNew
- isFailed
- getResults
- getTaskFunction
- getRetriesCount
- getError
- getResourceRental
- getExeUnit
- getState
- getDetails
Constructors
constructor
• new Task<OutputType
>(id
, taskFunction
, options?
)
Type parameters
Name | Type |
---|---|
OutputType | unknown |
Parameters
Name | Type |
---|---|
id | string |
taskFunction | TaskFunction <OutputType > |
options? | TaskOptions |
Defined in
Properties
retryOnTimeout
• Readonly
retryOnTimeout: boolean
Defined in
id
• Readonly
id: string
Implementation of
QueueableTask.id
Defined in
Methods
onStateChange
▸ onStateChange(listener
): void
Parameters
Name | Type |
---|---|
listener | (state : TaskState ) => void |
Returns
void
Defined in
cleanup
▸ cleanup(): void
Returns
void
Defined in
init
▸ init(): void
Returns
void
Defined in
start
▸ start(resourceRental
, exe
): void
Parameters
Name | Type |
---|---|
resourceRental | ResourceRental |
exe | ExeUnit |
Returns
void
Defined in
stop
▸ stop(results?
, error?
, retry?
): void
Parameters
Name | Type | Default value |
---|---|---|
results? | OutputType | undefined |
error? | Error | undefined |
retry | boolean | true |
Returns
void
Defined in
isQueueable
▸ isQueueable(): boolean
Returns
boolean
Implementation of
QueueableTask.isQueueable
Defined in
isRetry
▸ isRetry(): boolean
Returns
boolean
Defined in
isDone
▸ isDone(): boolean
Returns
boolean
Defined in
isFinished
▸ isFinished(): boolean
Returns
boolean
Defined in
isRejected
▸ isRejected(): boolean
Returns
boolean
Defined in
isQueued
▸ isQueued(): boolean
Returns
boolean
Defined in
isPending
▸ isPending(): boolean
Returns
boolean
Defined in
isNew
▸ isNew(): boolean
Returns
boolean
Defined in
isFailed
▸ isFailed(): boolean
Returns
boolean
Defined in
getResults
▸ getResults(): undefined
| OutputType
Returns
undefined
| OutputType
Defined in
getTaskFunction
▸ getTaskFunction(): TaskFunction
<OutputType
>
Returns
TaskFunction
<OutputType
>
Defined in
getRetriesCount
▸ getRetriesCount(): number
Returns
number
Defined in
getError
▸ getError(): undefined
| Error
Returns
undefined
| Error
Defined in
getResourceRental
▸ getResourceRental(): undefined
| ResourceRental
Returns
undefined
| ResourceRental
Defined in
getExeUnit
▸ getExeUnit(): undefined
| ExeUnit
Returns
undefined
| ExeUnit
Defined in
getState
▸ getState(): TaskState
Returns
Defined in
getDetails
▸ getDetails(): TaskDetails
Returns
Defined in
Was this helpful?