.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Daemon::Generic::While1 3pm" .TH Daemon::Generic::While1 3pm "2022-06-12" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" .Vb 1 \& Daemon::Generic::While1 \- Daemon framework with default while(1) loop .Ve .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& @ISA = qw(Daemon::Generic::While1); \& \& sub gd_run_body { \& # stuff \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a slight variation on Daemon::Generic: a default \&\f(CW\*(C`gd_run()\*(C'\fR provided. It has a \fBwhile\fR\|(1) loop that calls \&\f(CW\*(C`gd_run_body()\*(C'\fR over and over. It checks for reconifg and and terminate events and only actions them between calls to \f(CW\*(C`gd_run_body()\*(C'\fR. .PP Terminate events will be forced through after \&\f(CW$Daemon::Generic::force_quit_delay\fR seconds if \&\f(CW\*(C`gd_run_body()\*(C'\fR doesn't return quickly enough. .SH "SUBCLASS METHODS REQUIRD" .IX Header "SUBCLASS METHODS REQUIRD" The following method is required to be overridden to subclass Daemon::Generic::While1: .IP "\fBgd_run_body()\fR" 15 .IX Item "gd_run_body()" This method will be called over and over. This method should include a call to \f(CWsleep(1)\fR (or a bit more). Reconfig events will not interrupt it. Quit events will only interrupt it after 15 seconds. .SH "ADDITIONAL METHODS" .IX Header "ADDITIONAL METHODS" The following additional methods are available for your use (as compared to Daemon::Generic): .IP "gd_sleep($period)" 15 .IX Item "gd_sleep($period)" This will sleep for \f(CW$period\fR seconds but in one-second intervals so that if a \s-1SIGINT\s0 or \s-1SIGHUP\s0 arrives the sleep period can end more quickly. .Sp Using this makes it safe for \f(CW\*(C`gd_run_body()\*(C'\fR to sleep for longer than \f(CW$Daemon::Generic::force_quit_delay\fR seconds at a time. .SH "ADDITIONAL MEMBER DATA" .IX Header "ADDITIONAL MEMBER DATA" The following additional bits of member data are defined: .IP "gd_sigint" 15 .IX Item "gd_sigint" The time at which an (unprocessed) \s-1SIGINT\s0 was received. .IP "gd_sighup" 15 .IX Item "gd_sighup" The time at which an (unprocessed) \s-1SIGHUP\s0 was received. .SH "LICENSE" .IX Header "LICENSE" Copyright (C) 2006\-2010 David Muir Sharnoff . Copyright (C) 2011 Google, Inc. This module may be used and distributed on the same terms as Perl itself.