DedicatedWorkerGlobalScope.close()
close()
は DedicatedWorkerGlobalScope
インターフェイスのメソッドで、 DedicatedWorkerGlobalScope
のイベントループでキューに入れられたタスクを破棄し、この具体的なスコープを閉じます。
構文
js
close()
引数
なし。
返値
なし (undefined
)。
例
ワーカー自体の内部からワーカーインスタンスを閉じたい場合は、以下のように呼び出してください。
js
close();
close()
と self.close()
は事実上同じです。どちらも close()
がワーカーの内部スコープから呼び出されることを表します。
メモ:
メインスレッドからワーカーを停止する方法もあります。Worker.terminate
メソッドです。
仕様書
Specification |
---|
HTML # dom-dedicatedworkerglobalscope-close-dev |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
close |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on 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.