Task
The Task type represents a task function that has been registered with the Manager.
(
arg: string | undefined,
signal: AbortSignal,
info: TaskRunInfo,
): Promise<unknown>| Type | Description | |
|---|---|---|
arg | string | undefined | A string argument that might have been provided when the task was scheduled to run (or |
signal | AbortSignal | An AbortSignal that can be used to detect that the |
info | TaskRunInfo | A |
| returns | Promise<unknown> |
A task is an asynchronous function that is passed an optional string argument, an AbortSignal to indicate that execution should be ceased, and a reference to the Manager so that additional task runs can be scheduled if needed.
Note that a task can throw an exception to indicate that it has failed. It will then be considered for retrying if the run's TaskRunConfig allows for it.
Since
v1.0.0