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

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

544 544
545 ev_periodic_set (&periodic, 0., 3600., 0); 545 ev_periodic_set (&periodic, 0., 3600., 0);
546 546
547This doesn't mean there will always be 3600 seconds in between triggers, 547This doesn't mean there will always be 3600 seconds in between triggers,
548but only that the the callback will be called when the system time shows a 548but only that the the callback will be called when the system time shows a
549full hour (UTC), or more correct, when the system time is evenly divisible 549full hour (UTC), or more correctly, when the system time is evenly divisible
550by 3600. 550by 3600.
551 551
552Another way to think about it (for the mathematically inclined) is that 552Another way to think about it (for the mathematically inclined) is that
553C<ev_periodic> will try to run the callback in this mode at the next possible 553C<ev_periodic> will try to run the callback in this mode at the next possible
554time where C<time = at (mod interval)>, regardless of any time jumps. 554time where C<time = at (mod interval)>, regardless of any time jumps.
559ignored. Instead, each time the periodic watcher gets scheduled, the 559ignored. Instead, each time the periodic watcher gets scheduled, the
560reschedule callback will be called with the watcher as first, and the 560reschedule callback will be called with the watcher as first, and the
561current time as second argument. 561current time as second argument.
562 562
563NOTE: I<This callback MUST NOT stop or destroy the periodic or any other 563NOTE: I<This callback MUST NOT stop or destroy the periodic or any other
564periodic watcher, ever, or make any event loop modificstions>. If you need 564periodic watcher, ever, or make any event loop modifications>. If you need
565to stop it, return 1e30 (or so, fudge fudge) and stop it afterwards. 565to stop it, return C<now + 1e30> (or so, fudge fudge) and stop it afterwards.
566
567Also, I<<this callback must always return a time that is later than the
568passed C<now> value >>. Not even C<now> itself will be ok.
566 569
567Its prototype is c<ev_tstamp (*reschedule_cb)(struct ev_periodic *w, 570Its prototype is c<ev_tstamp (*reschedule_cb)(struct ev_periodic *w,
568ev_tstamp now)>, e.g.: 571ev_tstamp now)>, e.g.:
569 572
570 static ev_tstamp my_rescheduler (struct ev_periodic *w, ev_tstamp now) 573 static ev_tstamp my_rescheduler (struct ev_periodic *w, ev_tstamp now)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines