Class: Task<OutputType>
task/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
- getWorker
- getActivityReadySetupFunctions
- getRetriesCount
- getError
- getActivity
- getNetworkNode
Constructors
constructor
• new Task<OutputType
>(id
, worker
, options?
): Task
<OutputType
>
Type parameters
Name | Type |
---|---|
OutputType | unknown |
Parameters
Name | Type |
---|---|
id | string |
worker | Worker <OutputType > |
options? | TaskOptions |
Returns
Task
<OutputType
>
Defined in
Properties
id
• Readonly
id: string
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(activity
, networkNode?
): void
Parameters
Name | Type |
---|---|
activity | Activity |
networkNode? | NetworkNode |
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
getWorker
▸ getWorker(): Worker
<OutputType
>
Returns
Worker
<OutputType
>
Defined in
getActivityReadySetupFunctions
▸ getActivityReadySetupFunctions(): Worker
<unknown
>[]
Returns
Worker
<unknown
>[]
Defined in
getRetriesCount
▸ getRetriesCount(): number
Returns
number
Defined in
getError
▸ getError(): undefined
| Error
Returns
undefined
| Error
Defined in
getActivity
▸ getActivity(): undefined
| Activity
Returns
undefined
| Activity
Defined in
getNetworkNode
▸ getNetworkNode(): undefined
| NetworkNode
Returns
undefined
| NetworkNode