Class: Task<P>
Extends
Type Parameters
| Type Parameter |
|---|
|
Constructors
new Task()
ts
new Task<P>(
name,
work,
options?): Task<P>Parameters
| Parameter | Type | Description |
|---|---|---|
|
| Name of the task. |
| ( | Function that processes a task. |
|
| ‐ |
Returns
Task<P>
Overrides
Methods
handleError()
ts
handleError(
error?,
data?,
executionId?): voidParameters
| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
void
performLater()
ts
performLater(data, options?): Promise<ExecutionId | ExecutionId[]>Performs the task later, dispatching the task to a queue.
NOTES
In development, the task will be performed immediately.
In test, the task will collected ans can be retrieved with the performedTasks test helper.
Parameters
| Parameter | Type |
|---|---|
|
|
|
|
Returns
Promise<ExecutionId | ExecutionId[]>
performNow()
ts
performNow(data): Promise<void>Performs the task immediately in the current processs.
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
Promise<void>
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
id | readonly | string | Unique ID |
name | public | string | Name of the task. |
options? | public | TaskOptions<P> | - |
work | public | (task: object) => Promise<void> | Function that processes a task. |