ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-Watchdog/Watchdog.pm
(Generate patch)

Comparing AnyEvent-Watchdog/Watchdog.pm (file contents):
Revision 1.2 by root, Sun Aug 2 15:49:25 2009 UTC vs.
Revision 1.3 by root, Thu Aug 13 22:56:11 2009 UTC

118 118
119 } elsif ($cmd eq chr 3) { 119 } elsif ($cmd eq chr 3) {
120 sysread $P, my $interval, 1 120 sysread $P, my $interval, 1
121 or last; 121 or last;
122 122
123 $heartbeat = ord $interval 123 $heartbeat = ord $interval;
124 unless defined $heartbeat;
125 124
126 } elsif ($cmd eq chr 4) { 125 } elsif ($cmd eq chr 4) {
127 # heartbeat 126 # heartbeat
128 # TODO: should only reset heartbeat timeout with \005 127 # TODO: should only reset heartbeat timeout with \005
129 128
269twice as often. 268twice as often.
270 269
271Exit behaviour isn't changed, so if you want a restart instead of an exit, 270Exit behaviour isn't changed, so if you want a restart instead of an exit,
272you have to call C<autorestart>. 271you have to call C<autorestart>.
273 272
274Once enabled, the heartbeat cannot be switched off. 273The heartbeat frequency can be changed as often as you want, an interval
274of C<0> disables the heartbeat check again.
275 275
276=cut 276=cut
277 277
278sub heartbeat(;$) { 278sub heartbeat(;$) {
279 my ($interval) = @_; 279 my ($interval) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines