Now, I don’t want to give away the ending, but Web Workers are actually pretty simple to use.1 There are a few important limitations to keep in mind (e.g., no DOM access, limited BOM access) but Web Workers are otherwise a great candidate feature in the “HTML5 technology constellation” to perform heavyweight, long-running tasks. Green’s approach here is to provide simple explanations and then demonstrate the features in action with relevant code examples. With his explanations, you should be up and running with Web Workers in an afternoon.
That being said, I had a few minor quibbles closing the covers on this one. First, the sample code is available in a Github repo, but this isn’t mentioned until the closing remarks in the final chapter; this is a non-sensical place for them, especially considering that there is already a perfect place to mention them in the preface. Second, some of the code examples as they appear in the book are either rough-around-the-edges or else incomplete; for example, Example 3-4 has a variable declared twice, and Example 5-1 is missing the style information (meaning your version doesn’t look anything like the screenshot). I’m a bit of a pedant about these sorts of things, so they always rub me the wrong way, but they do not otherwise detract from the technical points that Green is trying to get a across in the book, so I won’t hold that against him.
Recommended? If you need to come up to speed on Web Workers quickly without anything extra? Yes.
Disclosure: I received an electronic copy of this book from the publisher in exchange for writing this review.
- Provided you’re in a browser that supports them. [↩]
About Rob FrieselSoftware engineer by day, science fiction writer by night. Author of The PhantomJS Cookbook and a short story in Please Do Not Remove. View all posts by Rob Friesel →
2 Responses to review: Web Workers
Pingback: 2012 Goals: Q3 check-in | found drama