Class: Task
- Last UpdatedJun 30, 2025
- 1 minute read
H.util.AsyncQueue.Task
This class represents a task as a cancelable work item managed by the AsyncQueue
.
Implements
Methods
-
This method provides the default implementation for cancelling a task. It has an effect only if the task is cancelled before it is processed. To implement task-specific cancelation, use the method
setCancelFn()
on theAsyncQueue
object. -
This method signals that the processing of a task is complete. The method must be called from the task processing function to inform the queue that further tasks can be processed.
Name Type Description result
* The result of the task processing operation
opt_error
* optional An optional error message to use in the event of an error during the processing of the task.
-
setCancelFn (cancelFn)H.util.AsyncQueue.Task
-
This method sets a function to be invoked when a task-specific operation is to be canceled to allow for ad-hoc canceling during the processing of the task.
Name Type Description cancelFn
function nullable The function to be called when canceling task
Returns:
Type Description H.util.AsyncQueue.Task An object representing the cancelled task