Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The combination of timers and web workers opens new opportunities in the development of client-centric HTML5 applications. It is possible to make your application artificially intelligent (in a very basic way) by giving it a set of functions called at a regular interval. Although these operations can be performed in the main thread, it is often optimal to perform them in a separate worker thread process.
In this hack we will gain inspiration from Angus Croll’s post, “web workers vs. the crazy flies”.
For the most part, we will use most of Angus’s design, where he animates flies that are eliminated over time based on array manipulations being performed within web workers (see Figure 8-9). We will do much the same thing, but add our own flavor to the hack.