Michael Van Sickle is an application architect in Akron, Ohio.
He is a mechanical engineer by training and a software engineer by choice.
He is passionate about learning new programming languages and user
The Basics Hello and welcome back to this course where we're learning how to add Web Workers to our web applications. In the last module we got introduced to Web Workers, learned a little bit about their history, and started to see how easy it really is to work with Web Workers. Well, in this module we're going to take a deep dive into the basics and teach you everything that you need to know about the mechanics of Web Workers. So this module is going to shape up like this. First we're going to talk about messages and how we can create messages that we're passing between our different workers and the main thread of the application. Now the rules aren't hard, but there are a couple rules that we're going to have to keep in mind about what can and cannot be included inside of a message. After that we'll move into the available APIs that you can access within a worker. Now as we mentioned in module 1, not everything that you can do in a web application is going to be available inside of a worker. For example, you don't have the concept of a DOM inside of a web worker since that's a UI construct and Web Workers aren't allowed to access the UI. After we talk about the APIs, we'll take a little bit of a detour and see how to load additional scripts into your Web Workers. This is going to be really important, especially if you're trying to load a framework or a toolkit into your web worker, you're going to need to know how to do that. After that, we're going to dive into the two different types of Web Workers that are out there and play around with the different types and see how you might be able to use each one in your applications. And finally we'll talk about the worker lifecycle. Now the lifecycle of a web worker isn't really that complicated; however, there are some key events that are we're going to need to be aware of and some gotchas that can catch you if you're not aware of them. Okay, so let's get started by talking about messages next.