Is there some way to synchronously wait for or check for a new message in a web-worker?
I have a large complicated body of code (compiled LLVM from emscripten) that I c
Can you break the sequence as follow without refactoring?
wrk.onmessage = function(e) {
if (e.data.step === 'initial input') {
doInitialWork(e.data.inputs)
} else if (e.data.step === 'ui input') {
doTheRest(e.data.uiData)
}
}
The onmessage event will be blocked until the initial step execution stack is complete and the critical ui bits will only launch when and if the info is available.