ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.html
(Generate patch)

Comparing libev/ev.html (file contents):
Revision 1.11 by root, Mon Nov 12 08:32:51 2007 UTC vs.
Revision 1.12 by root, Mon Nov 12 08:35:18 2007 UTC

4<head> 4<head>
5 <title>libev</title> 5 <title>libev</title>
6 <meta name="description" content="Pod documentation for libev" /> 6 <meta name="description" content="Pod documentation for libev" />
7 <meta name="inputfile" content="&lt;standard input&gt;" /> 7 <meta name="inputfile" content="&lt;standard input&gt;" />
8 <meta name="outputfile" content="&lt;standard output&gt;" /> 8 <meta name="outputfile" content="&lt;standard output&gt;" />
9 <meta name="created" content="Mon Nov 12 09:32:51 2007" /> 9 <meta name="created" content="Mon Nov 12 09:35:17 2007" />
10 <meta name="generator" content="Pod::Xhtml 1.57" /> 10 <meta name="generator" content="Pod::Xhtml 1.57" />
11<link rel="stylesheet" href="http://res.tst.eu/pod.css"/></head> 11<link rel="stylesheet" href="http://res.tst.eu/pod.css"/></head>
12<body> 12<body>
13<div class="pod"> 13<div class="pod">
14<!-- INDEX START --> 14<!-- INDEX START -->
550<pre> ev_periodic_set (&amp;periodic, 0., 3600., 0); 550<pre> ev_periodic_set (&amp;periodic, 0., 3600., 0);
551 551
552</pre> 552</pre>
553 <p>This doesn't mean there will always be 3600 seconds in between triggers, 553 <p>This doesn't mean there will always be 3600 seconds in between triggers,
554but only that the the callback will be called when the system time shows a 554but only that the the callback will be called when the system time shows a
555full hour (UTC), or more correct, when the system time is evenly divisible 555full hour (UTC), or more correctly, when the system time is evenly divisible
556by 3600.</p> 556by 3600.</p>
557 <p>Another way to think about it (for the mathematically inclined) is that 557 <p>Another way to think about it (for the mathematically inclined) is that
558<code>ev_periodic</code> will try to run the callback in this mode at the next possible 558<code>ev_periodic</code> will try to run the callback in this mode at the next possible
559time where <code>time = at (mod interval)</code>, regardless of any time jumps.</p> 559time where <code>time = at (mod interval)</code>, regardless of any time jumps.</p>
560 </dd> 560 </dd>
563 <p>In this mode the values for <code>interval</code> and <code>at</code> are both being 563 <p>In this mode the values for <code>interval</code> and <code>at</code> are both being
564ignored. Instead, each time the periodic watcher gets scheduled, the 564ignored. Instead, each time the periodic watcher gets scheduled, the
565reschedule callback will be called with the watcher as first, and the 565reschedule callback will be called with the watcher as first, and the
566current time as second argument.</p> 566current time as second argument.</p>
567 <p>NOTE: <i>This callback MUST NOT stop or destroy the periodic or any other 567 <p>NOTE: <i>This callback MUST NOT stop or destroy the periodic or any other
568periodic watcher, ever, or make any event loop modificstions</i>. If you need 568periodic watcher, ever, or make any event loop modifications</i>. If you need
569to stop it, return 1e30 (or so, fudge fudge) and stop it afterwards.</p> 569to stop it, return <code>now + 1e30</code> (or so, fudge fudge) and stop it afterwards.</p>
570 <p>Also, <i>&lt;this callback must always return a time that is later than the
571passed <code>now</code> value </i>&gt;. Not even <code>now</code> itself will be ok.</p>
570 <p>Its prototype is c&lt;ev_tstamp (*reschedule_cb)(struct ev_periodic *w, 572 <p>Its prototype is c&lt;ev_tstamp (*reschedule_cb)(struct ev_periodic *w,
571ev_tstamp now)&gt;, e.g.:</p> 573ev_tstamp now)&gt;, e.g.:</p>
572<pre> static ev_tstamp my_rescheduler (struct ev_periodic *w, ev_tstamp now) 574<pre> static ev_tstamp my_rescheduler (struct ev_periodic *w, ev_tstamp now)
573 { 575 {
574 return now + 60.; 576 return now + 60.;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines