close
Summary
Discards any pending tasks and immediately closes the worker.
Method of apis/workers/WorkerGlobalScopeapis/workers/WorkerGlobalScope
Syntax
object.close();
Return Value
No return value
Notes
This method sets the worker’s WorkerGlobalScope object’s closing flag to true, preventing any further tasks from being queued.
Use the terminate method if you want to stop a worker from a parent thread.
Related specifications
- W3C Web Workers Specification
- W3C Editor’s Draft
Attributions
Microsoft Developer Network: Windows Internet Explorer API reference Article