Web Worker Experiments
- Experiment 01 · Worker instantiation
Using either Classic-, Module- or Embedded scripts, experience whether or not your browser supports these ways of instantiating workers; and how to report errors from the worker, how to handle them in the browser. - Experiment 02 · Async Generators
Single worker, or delegation to multiple subworkers. An experiment to check whether or not workers of your browser can consume data asynchronously from generator functions; that we can return the data in arrays; and that we can spawn subworkers. - Experiment 03 · Transferrable Objects
The Browser uses the structured clone algorithm to pass data in/out of Workers; it supports complex data types, such asFile
,Blob
,ArrayBuffer
, but the copy can take hundreds of milliseconds for large objects. Transferable objects can be transfered from one context to the other; it is a zero-copy. Check whether it works in your browser — while filtering an image in a worker and returning anImageBitmap
, which is aTransferable
object.