kripken/emscripten — pull request #2780 by NWilson (2014-09-11 10:39:16+00:00)
Title: Add an emscripten_wake_sleep() function

This function makes it easy for application developers to write a main loop using an asynchronous main() with ASYNCIFY.

Our plan here is to skip using `emscripten_set_main_loop` functions since we're moving to using ASYNCIFY, and instead put the main loop in an interruptible wait.

Because we use some rather specific options and behaviour, we aren't using the `emscripten_wget` and emscripten sockets-as-WebSockets code, with our own JavaScript library for getting these events into our main loop.

I thought I'd like to contribute this change we're using to `emscripten_sleep` though, because I think it should be generally useful to other developers who want to build a main loop using ASYNCIFY.