Worker

From CommonJS Spec Wiki
Jump to: navigation, search

Worker Module Specification

STATUS: PROPOSAL

The worker module exists for the purpose of creating workers, concurrent shared nothing processes/threads, that can communicate with other workers with message passing.

Proposals

The 'worker' module must export Worker, SharedWorker, and optionally name. Worker and SharedWorker are constructors that follow the W3C/HTML5 WebWorkers specification: http://dev.w3.org/html5/workers/ The primary difference is that script names should follow CommonJS module naming mechanism, and should be resolved using the same mechanism the 'require' function. The 'worker' module may also export a 'name' property that indicates the name of the current worker (if started as a named SharedWorker).