Web Worker API

  1. What is a web worker
  1. Spawning a web worker
  1. Communicating with a web worker
  1. Terminate a web worker

Types of web workers

  1. Dedicated workers
  1. Shared Workers

Limitations

  1. Same origin policy
  1. Limited Access - Ex: DOM, Document Object, Window, Parent.
  1. Restricted Local Access

Can we embedded Workers?

Examples

Demo

scenarios

  1. Syntax highlighting in code editors
  1. Games

Graphics

Crypto

Handling Ajax call backs even if user navigates to different page

Imagine if we are building an Excel app, which will have intensive calculations.

  1. Cannot interrupt a worker

5.Cannot Share memory between two threads

In browser extensions

Browser Support