Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. TaskSignal

TaskSignal

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Note: This feature is available inWeb Workers.

TheTaskSignal interface of thePrioritized Task Scheduling API represents a signal object that allows you to communicate with a prioritized task, and abort it or change thepriority (if required) via aTaskController object.

An object of this type is created, and associated with, aTaskController.The initial priority of the signal may be set by specifying it as an argument to theTaskController() constructor (by default it is"user-visible").The priority can be changed by callingTaskController.setPriority() on the controller.

The signal may be passed as theoptions.signal argument inScheduler.postTask(), after which its associated controller can be used to abort the task.If thetask 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 anAbortSignal as theoptions.signal argument.

EventTarget AbortSignal TaskSignal

Instance properties

TheTaskSignal interface also inherits properties from its parent interface,AbortSignal.

TaskSignal.priorityRead only

Returns the priority of the signal.

Static methods

TheTaskSignal interface inherits methods from its parent interface,AbortSignal.

TaskSignal.any()

Returns aTaskSignal that aborts when any of the given abort signals abort.

Instance methods

TheTaskSignal interface inherits methods from its parent interface,AbortSignal.

Events

Listen to these events usingaddEventListener() or by assigning an event listener to theoneventname property of this interface.

prioritychange

Fired when the priority is changed.This is triggered by callingTaskController.setPriority() on the associated controller.

Examples

Examples for how theTaskSignal is created and used for prioritizing and aborting tasks can be found here:

Specifications

Specification
Prioritized Task Scheduling
# tasksignal

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp