Class: Task
One computation unit.
description
Represents one computation unit that will be run on the provider (e.g. rendering of one frame of an animation).Name |
---|
TaskData |
TaskResult |
• new Task(
data
)Create a new Task object.
Type parameters
Name |
---|
TaskData |
TaskResult |
Parameters
Name | Type | Description |
---|---|---|
data | TaskData | contains information needed to prepare command list for the provider |
Defined in
•
Private
_callbacks: Set
<null
| Function>Defined in
•
Private
_data: any
Defined in
•
Private
_emit_event: any
Defined in
•
Private
_finished: null
| number
Defined in
Defined in
•
Private
Optional
_result: null
| TaskResult
Defined in
•
Private
_started: null
| number
Defined in
Defined in
• id:
number
= 0Defined in
▪
Static
count: number
= 0Defined in
•
Static
get
counter(): number
Returns
number
Defined in
▸ _add_callback(
callback
): void
Parameters
Name | Type |
---|---|
callback | Function |
Returns
void
Defined in
▸ _start(
_emitter
): void
Parameters
Name | Type |
---|---|
_emitter | any |
Returns
void
Defined in
▸ _stop(
retry?
): void
Parameters
Name | Type | Default value |
---|---|---|
retry | boolean | false |
Returns
void
Defined in
▸ accept_result(
result?
): void
Accept the result of this task.
description
Must be called when the result is correct to mark this task as completed.Parameters
Name | Type | Default value | Description |
---|---|---|---|
result | null | TaskResult | null | task computation result (optional) |
Returns
void
Defined in
▸ data():
TaskData
Returns
TaskData
Defined in
▸ reject_result(
reason?
, retry?
): void
Reject the result of this task.
description
Must be called when the result is not correct to indicate that the task should be retried.Parameters
Name | Type | Default value | Description |
---|---|---|---|
reason | null | string | null | Task rejection description (optional) |
retry | boolean | false | Task retry in case of rejects (optional) |
Returns
void
Defined in
▸ result():
undefined
| null
| TaskResult
Returns
undefined
| null
| TaskResult
Defined in
▸ running_time():
null
| number
Returns
null
| number
Defined in
Returns
Defined in
Parameters
Returns
Defined in
Last modified 1yr ago