-one iteration of the loop.</p>
- <p>This flags value could be used to implement alternative looping
-constructs, but the <code>prepare</code> and <code>check</code> watchers provide a better and
-more generic mechanism.</p>
- <p>Here are the gory details of what ev_loop does:</p>
-<pre> 1. If there are no active watchers (reference count is zero), return.
- 2. Queue and immediately call all prepare watchers.
- 3. If we have been forked, recreate the kernel state.
- 4. Update the kernel state with all outstanding changes.
- 5. Update the "event loop time".
- 6. Calculate for how long to block.
- 7. Block the process, waiting for events.
- 8. Update the "event loop time" and do time jump handling.
- 9. Queue all outstanding timers.
- 10. Queue all outstanding periodics.
- 11. If no events are pending now, queue all idle watchers.
- 12. Queue all check watchers.
- 13. Call all queued watchers in reverse order (i.e. check watchers first).
- 14. If ev_unloop has been called or EVLOOP_ONESHOT or EVLOOP_NONBLOCK
- was used, return, otherwise continue with step #1.
+one iteration of the loop. This is useful if you are waiting for some
+external event in conjunction with something not expressible using other
+libev watchers. However, a pair of <code>ev_prepare</code>/<code>ev_check</code> watchers is
+usually a better approach for this kind of thing.</p>
+ <p>Here are the gory details of what <code>ev_loop</code> does:</p>
+<pre> * If there are no active watchers (reference count is zero), return.
+ - Queue prepare watchers and then call all outstanding watchers.
+ - If we have been forked, recreate the kernel state.
+ - Update the kernel state with all outstanding changes.
+ - Update the "event loop time".
+ - Calculate for how long to block.
+ - Block the process, waiting for any events.
+ - Queue all outstanding I/O (fd) events.
+ - Update the "event loop time" and do time jump handling.
+ - Queue all outstanding timers.
+ - Queue all outstanding periodics.
+ - If no events are pending now, queue all idle watchers.
+ - Queue all check watchers.
+ - Call all queued watchers in reverse order (i.e. check watchers first).
+ Signals and child watchers are implemented as I/O watchers, and will
+ be handled here by queueing them when their watcher gets executed.
+ - If ev_unloop has been called or EVLOOP_ONESHOT or EVLOOP_NONBLOCK
+ were used, return, otherwise continue with step *.
+
+</pre>
+ <p>Example: queue some jobs and then loop until no events are outsanding
+anymore.</p>
+<pre> ... queue jobs here, make sure they register event watchers as long
+ ... as they still have work to do (even an idle watcher will do..)
+ ev_loop (my_loop, 0);
+ ... jobs done. yeah!