This is a proof of concept of exposing a sync calls API from the Web Worker
It’s only possible to make async calls when a Web Worker sends messages to the
main thread or other Worker threads, ie
Sometimes we want to use synchronous calls instead for various reasons.
- main.js — main thread which exposes API to the Worker thread
- worker.js — Worker thread with sync calls
- api.js — this file includes both main thread logic and Worker thread logic implementation