This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"originalId": "3587258", | |
"title": "Blocking until event", | |
"text": "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?", | |
"owner": { | |
"displayName": "Michael", | |
}, | |
"accepted": false, | |
"acceptedAnswerId": null, | |
"answerCount": 1, | |
"answers": [ | |
{ | |
"text": "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. ", | |
"owner": { | |
"displayName": "epascarello", | |
}, | |
"id": "soa3588111" | |
} | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment