In a web worker, I'm firing off a postMessage() and need to wait for the result before continuing execution. Is there anyway of blocking until the onMessage event occurs, short of busy waiting plus something like Peterson's Algorithm?
A:
Sounds like you need to break up your script into two parts and fire the second part when the message comes back. That is how any asynchronous call works in the JavaScript world.
epascarello
2010-08-27 21:06:28