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
- getWorker
- getActivityReadySetupFunctions
- getRetriesCount
- getError
- getActivity
- getNetworkNode
- getState
- getDetails
Constructors
constructor
• new Task<OutputType
>(id
, worker
, options?
)
Type parameters
Name | Type |
---|---|
OutputType | unknown |
Parameters
Name | Type |
---|---|
id | string |
worker | Worker <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(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
Defined in
getState
â–¸ getState(): TaskState
Returns
Defined in
getDetails
â–¸ getDetails(): TaskDetails