November 2011
Intermediate to advanced
384 pages
13h 23m
English
To use a Web Worker in your website, your mainline JavaScript program, known as the parent thread, must construct the worker object from a constructor and its source code. This object can then be used to communicate to the worker by way of event messages.
The event message syntax used in the parent program is almost identical to the Web Worker code, barring a couple differences. First, the initial call to the constructor forms a worker object that facilitates communication, whereas the Web Worker within aptly uses self for communication. Second, your parent program has the capability to listen to runtime errors caused by the worker thread. Although this may not help you with debugging per se, if an issue ...
Read now
Unlock full access