Executes the task with the given input.
This method must be implemented by subclasses to define the actual work performed by the task. Can return either a synchronous result or a Promise.
The input data for the task.
The task result, either synchronous or asynchronous.
Represents a named unit of work with an asynchronous or synchronous execution function.
Tasks can be chained together in a scheduler to create complex workflows with proper data flow and error handling.
Example