Course info
Oct 13, 2016
1h 57m

In recent years, JavaScript has risen to become one of the most important languages in modern software development. However, despite the powerful engines that run it, it is often limited by its single-threaded nature. In this course, Shifting JavaScript into High Gear with Web Workers, you will learn how to work around that constraint in web applications by using the WebWorker API to allow your application to take advantage of the full power that your customer's computers have to offer. First, you will get to see why web workers are the preferred solution for adding parallel execution paths to an application. Next, you'll get a step-by-step overview of the various aspects of working with web workers, such as defining messages and what APIs can be accessed from within a worker. Finally, you'll see how web workers can be added to a real-world application in a way that causes the smallest disruption possible to the application's structure, while gaining the advantages inherent with workers. After finishing this course, you will be ready to implement web workers into your multi-threaded applications with minimum hassle.

About the author
About the author

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 experience design.

More from the author
The Go CLI Playbook
2h 8m
28 Feb 2018
Intern 4: Getting Started
2h 41m
9 Jan 2018
Object-oriented Programming with Go
1h 42m
11 Aug 2017
More courses by Mike Van Sickle
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone. My name is Michael Van Sickle and welcome to my course, Shifting JavaScript into High Gear with Web Workers. I'm a software engineer at SitePen. JavaScript is becoming increasingly relied on in modern application development, but it started to be constrained by its single-threaded execution model. By incorporating Web Workers into an application, new levels of performance are possible. In this course, we're going to learn the basics of the Web Worker API and then explore some ways that they can be used in real world applications. Some of the major topics that we will cover include the types of web workers that exist, how to communicate with a web worker, and how to incorporate web workers into real world projects. By the end of this course, you'll know how to best use web workers in your next web application. Before beginning the course, you should be familiar with client-side JavaScript development. I hope you'll join me on this journey to learn about web workers with the Shifting JavaScript into High Gear with Web Workers course at Pluralsight.

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.