Web Worker API
- What is a web worker
- Spawning a web worker
- Communicating with a web worker
- Terminate a web worker
Types of web workers
- Dedicated workers
- Shared Workers
Limitations
- Same origin policy
- Limited Access - Ex: DOM, Document Object, Window, Parent.
- Restricted Local Access
Can we embedded Workers?
Examples
Demo
scenarios
- Syntax highlighting in code editors
- 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.
- Cannot interrupt a worker
5.Cannot Share memory between two threads
In browser extensions
Browser Support