Hi all,
I'm not sure if this was brought up in the past, sorry about that if it
was :-)
So, I was wondering if a patch adding a way to break the loop would be
welcome. It's functionality would pretty much mirror ev_break but since
we have no concept of depth and so on I guess it would be simpler.
The idea would be to return from uv_run in the next iteration, if
uv_break was called. I haven't thought about all possible cases here
like, what should we do if you do uv_break in a prepare callback (should
we break before poll or not?) but I'd like to get some feedback on the
general idea.
Someone may want to break the loop under certain conditions (probably
mainly errors) and do some extra cleanup before closing all handles, for
example.
Particularly, I would like to have some sort of "debug mode" on pyuv,
where the loop would automatically exited if there is an uncaught
exception in any of the callbacks, and then it's up to the user to do
whatever he wants, ie walk the loop and close all handles, or just exit.
Thoughts?
--
Sa�l Ibarra Corretg�
http://saghul.net/blog |
http://about.me/saghul