joyent/libuv — pull request #535 by saghul (2012-08-23 08:03:34+00:00)
Title: Implemented uv_run2 (adding flags to uv_run)

Allows for running the event loop in 3 modes:
* default: loop runs until the refcount drops to zero
* once: poll for events only once and block until one is handled
* nowait: poll for events only once but don't block if there are
no pending events

The patch contains the Unix implementation, I'll do the Windows one after some initial feedback.

I thought changing uv_run could be a bit too much, so the new functionality is implemented as uv_run2. I did remove uv_run_once, since it's very straightforward to mock with a define, for software which runs on 0.8 and 0.9.

Related issue: #339

/cc @bnoordhuis @piscisaureus