found drama

get oblique

review: Web Workers

by Rob Friesel

Web WorkersIdo Green’s Web Workers: Multithreaded Programs in JavaScript (O’Reilly, 2012) is a dive into the emerging API of Web Workers. It’s a short book–at 46 pages, it may as well be a chapter from another technical book–but it’s free of fluff, and laser focused on one topic, and one topic only. But this is just fine; we’re only here to learn about Web Workers, after all.

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.

  1. Provided you’re in a browser that supports them. []

About Rob Friesel

Software engineer by day, science fiction writer by night; weekend homebrewer. 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

Leave a Reply

Your email address will not be published. Required fields are marked *