Hi,
On 4/15/14 9:46 PM, Benjamin Ylvisaker wrote:
I'm curious about the return value from a call to uv_run(l,
UV_RUN_NOWAIT). It's pretty clear to me that if there is nothing in the
loop at all it will return 0. What I'm not clear on is the situation
where there are handlers left in the loop, but none of them is ready to
go right now.
It will return 1. If you have an initialized uv_async_t handle, for
example, it's always active, so the loop needs to run until you close it.
What I would like to write is something like:
while( events ready to go right now ) {
uv_run( l, UV_RUN_NOWAIT );
}
What are you trying to achieve? When you run the loop with UV_RUN_NOWAIT
it will do a zero timeout poll, so if you just have a timer set for 60
seconds and a TCP socket you'll busy-loop unnecessarily.
Is this easy/possible?
It's possible, but I think you can do it differently. Maybe you can
explain better?
FWIW, uv_loop_alive will tell you if there are active/ref'd handles in
the loop.
Cheers,
--
Saúl Ibarra Corretgé
http://bettercallsaghul.com
--
You received this message because you are subscribed to the Google Groups
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.