Creates a new task instance.
Builder used to create the task.
Name of the task.
Configuration for the task.
Input data for the task.
Protected
_progressProgress of the task (range 0 to 1).
Protected
_resultTask result, wrapped in an Optional
object.
Protected
_statusCurrent status of the task.
Readonly
builderBuilder used to create the task.
Readonly
dataInput data for the task.
Readonly
idUnique identifier for the task.
Protected
loggerLogger for task-related events.
Readonly
nameName of the task.
Progress of the task (range 0 to 1).
Updates the task progress.
New progress value (0 to 1).
Task result, wrapped in an Optional
object.
Sets the task result.
Result to set.
Current status of the task.
Updates the task status.
New status to set.
Removes all listeners for all event types, as well as all global listeners.
The EventEmitter instance itself, allowing for method chaining.
Emits an event of a specific type, invoking all registered listeners for that event type with the provided data. Also calls any global event listeners with a GlobalEvent object.
Event type.
The identifier for the event type to emit.
The data to pass to the event listeners. The type of this data is defined by the corresponding value in TEvents.
The EventEmitter instance itself, allowing for method chaining.
Checks if the task status matches any of the provided statuses.
List of statuses to check.
true
if the current status matches one of the provided statuses.
Removes a previously registered event listener for a specified event type. Use this method to unregister listeners when they are no longer needed, preventing potential memory leaks.
Event type.
The identifier for the event type from which to remove the listener.
The callback function to unregister.
The EventEmitter instance itself, allowing for method chaining.
Removes a previously registered global event listener.
The global event listener to remove.
The EventEmitter instance itself, allowing for method chaining.
Adds an event listener for a specified event type. This method allows you to specify which event you are interested in listening to and to provide a callback function that will be executed whenever that event is emitted.
Event type.
The identifier for the event type to listen for.
The callback function that will be called when the event is emitted.
The EventEmitter instance itself, allowing for method chaining.
Adds a global event listener that is called for every emitted event.
The global event listener to add.
The EventEmitter instance itself, allowing for method chaining.
Parses the task for UI rendering.
Parsed task data.
Protected
setSets the task status.
Status to set.
Instance of the task for chaining.
Single task within the task management system.