From the course: JavaScript: Async

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Identifying use cases for web workers

Identifying use cases for web workers - JavaScript Tutorial

From the course: JavaScript: Async

Identifying use cases for web workers

- [Instructor] The ability to create a shared worker was originally developed as a way to avoid duplicating resources that need to be shared by just sharing one extra thread. However, if I check support on something like can I use, we can see that shared workers are not widely supported by modern browsers. And in fact, support has been removed in some cases because shared workers were not widely used and they presented some architectural issues for browser makers. A separate but related technology known as a service worker can perform some of what a shared worker was originally designed to do. Like a web worker, a service worker runs in a separate thread, but instead of simply running code and sending a response back to the app, a service worker is optimized to make network requests, monitor responses, and work with those responses all in the background. Another related feature is a WebSocket. A WebSocket maintains a…

Contents