files/en-us/web/api/tasksignal/index.md
{{APIRef("Prioritized Task Scheduling API")}}{{AvailableInWorkers}}
The TaskSignal interface of the Prioritized Task Scheduling API represents a signal object that allows you to communicate with a prioritized task, and abort it or change the priority (if required) via a {{domxref('TaskController')}} object.
An object of this type is created, and associated with, a {{domxref('TaskController')}}.
The initial priority of the signal may be set by specifying it as an argument to the {{domxref("TaskController.TaskController", "TaskController()")}} constructor (by default it is "user-visible").
The priority can be changed by calling {{domxref("TaskController.setPriority()")}} on the controller.
The signal may be passed as the options.signal argument in {{domxref("Scheduler.postTask()")}}, after which its associated controller can be used to abort the task.
If the task priority is mutable, the controller can also be used to change the task's priority.
Abortable tasks that do not need the priority to change may instead specify an {{domxref("AbortSignal")}} as the options.signal argument.
{{InheritanceDiagram}}
The TaskSignal interface also inherits properties from its parent interface, {{domxref("AbortSignal")}}.
The TaskSignal interface inherits methods from its parent interface, {{domxref("AbortSignal")}}.
TaskSignal that aborts when any of the given abort signals abort.The TaskSignal interface inherits methods from its parent interface, {{domxref("AbortSignal")}}.
Listen to these events using {{domxref("EventTarget.addEventListener()", "addEventListener()")}} or by assigning an event listener to the oneventname property of this interface.
Examples for how the TaskSignal is created and used for prioritizing and aborting tasks can be found here:
TaskController > ExamplesTaskSignal: prioritychange event > Examples{{Specifications}}
{{Compat}}