From 37de1ba2225149cd64fdde06bd781b3ca3fc443a Mon Sep 17 00:00:00 2001 From: root Date: Mon, 2 Apr 2012 23:14:40 +0000 Subject: *** empty log message *** --- ev.pod | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ev.pod') diff --git a/ev.pod b/ev.pod index 9ea2cd6..e185fa5 100644 --- a/ev.pod +++ b/ev.pod @@ -794,18 +794,22 @@ without a previous call to C. Calling C/C has the side effect of updating the event loop time (see C). -=item ev_run (loop, int flags) +=item bool ev_run (loop, int flags) Finally, this is it, the event handler. This function usually is called after you have initialised all your watchers and you want to start handling events. It will ask the operating system for any new events, call -the watcher callbacks, an then repeat the whole process indefinitely: This +the watcher callbacks, and then repeat the whole process indefinitely: This is why event loops are called I. If the flags argument is specified as C<0>, it will keep handling events until either no event watchers are active anymore or C was called. +The return value is false if there are no more active watchers (which +usually means "all jobs done" or "deadlock"), and true in all other cases +(which usually means " you should call C again"). + Please note that an explicit C is usually better than relying on all watchers to be stopped when deciding when a program has finished (especially in interactive programs), but having a program @@ -813,8 +817,8 @@ that automatically loops as long as it has to and no longer by virtue of relying on its watchers stopping correctly, that is truly a thing of beauty. -This function is also I exception-safe - you can break out of -a C call by calling C in a callback, throwing a C++ +This function is I exception-safe - you can break out of a +C call by calling C in a callback, throwing a C++ exception and so on. This does not decrement the C value, nor will it clear any outstanding C breaks. -- cgit v1.2.3