This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

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