joyent/libuv — Issue #339: Proposal: add flags to uv_run, a la ev_run
Author: saghul
Created: 2012-03-09 08:17:05+00:00
State: open

I noticed issue #291, and I think (please, correct me if I'm wrong), that the implementation of NOWAIT in Windows would just involve passing false to the call to poll here: https://github.com/joyent/libuv/blob/master/src/win/core.c#L237 (perhaps with a new parameter to UV_LOOP_ONCE, but I didn't hink too much of that yet).

So assuming that would be added there would be uv_run, uv_run_one and uv_run_nowait (or uv_run_once_nowait). What about having something like this:

typedef enum {
UV_RUN_DEFAULT = 0,
UV_RUN_ONCE = 1,
UV_RUN_NOWAIT = 2,
} uv_run_flags;

And then just a single run function:

int uv_run(uv_loop_t *loop, int flags)

Thoughts? If I get an ok I could work on a patch and submit a pull request :-)