La méthode terminate()
de l'interface Worker
termine immédiatement le Worker
. Cette interruption ne permet pas au worker de finaliser ses opérations, il est juste arrêté sur le champ.
Syntaxe
myWorker.terminate();
Paramètres
Aucun.
Valeur de retour
Néant.
Exemple
L'extrait de code suivant montre la création d'un objet Worker
en utilisant le constructeur Worker()
, qui est alors immédiatement interrompu.
var myWorker = new Worker("worker.js");
myWorker.terminate();
Spécifications
Spécification | Statut | Commentaire |
---|---|---|
HTML Living Standard La définition de 'Worker.terminate()' dans cette spécification. |
Standard évolutif |
Compatibilité des navigateurs
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Voir aussi
L'interface Worker
à laquelle elle appartient.