“client side js is single threaded”
“erm actually using web-workers you can create multi threaded applications in client side js” - 🤓
Setup #
The Web Workers API lets users create dedicated worker threads in the browser to run a specified script.
To use SharedArrayBuffer (the primary way web workers can share memory) the Cross-Origin-Embedder-Policy
and Cross-Origin-Opener-Policy
headers must be set to require-corp
and same-origin
.
python -m http.server
is typically my go to run quickly a http server, but i couldn’t find an easy way to set headers - so i ended up using FastAPI.