1Daemon::Generic::While1U(s3e)r Contributed Perl DocumentaDtaieomnon::Generic::While1(3)
2
3
4

NAME

6        Daemon::Generic::While1 - Daemon framework with default while(1) loop
7

SYNOPSIS

9        @ISA = qw(Daemon::Generic::While1);
10
11        sub gd_run_body {
12               # stuff
13        }
14

DESCRIPTION

16       This is a slight variation on Daemon::Generic: a default "gd_run()"
17       provided.  It has a while(1) loop that calls "gd_run_body()" over and
18       over.  It checks for reconifg and and terminate events and only actions
19       them between calls to "gd_run_body()".
20
21       Terminate events will be forced through after
22       $Daemon::Generic::force_quit_delay seconds if "gd_run_body()" doesn't
23       return quickly enough.
24

SUBCLASS METHODS REQUIRD

26       The following method is required to be overridden to subclass
27       Daemon::Generic::While1:
28
29       gd_run_body()  This method will be called over and over.  This method
30                      should include a call to sleep(1) (or a bit more).
31                      Reconfig events will not interrupt it.  Quit events will
32                      only interrupt it after 15 seconds.
33

ADDITIONAL METHODS

35       The following additional methods are available for your use (as
36       compared to Daemon::Generic):
37
38       gd_sleep($period)
39                      This will sleep for $period seconds but in one-second
40                      intervals so that if a SIGINT or SIGHUP arrives the
41                      sleep period can end more quickly.
42
43                      Using this makes it safe for "gd_run_body()" to sleep
44                      for longer than $Daemon::Generic::force_quit_delay
45                      seconds at a time.
46

ADDITIONAL MEMBER DATA

48       The following additional bits of member data are defined:
49
50       gd_sigint      The time at which an (unprocessed) SIGINT was received.
51
52       gd_sighup      The time at which an (unprocessed) SIGHUP was received.
53

LICENSE

55       Copyright (C) 2006-2010 David Muir Sharnoff <muir@idiom.com>.
56       Copyright (C) 2011 Google, Inc.  This module may be used and
57       distributed on the same terms as Perl itself.
58
59
60
61perl v5.32.1                      2021-01-27        Daemon::Generic::While1(3)
Impressum