Daemon:...::While1(3)
π NAME π
okay bestie, this page is Daemon:...::While1(3) from the User Contributed Perl Documentation β the module is Daemon::Generic::While1, aka a daemon framework with a default while(1) loop. iconic.
β¨ SYNOPSIS β¨
@ISA = qw(Daemon::Generic::While1);
sub gd_run_body {
# stuff
}
π¦ DESCRIPTION π¦
okay so this is a slight variation on Daemon::Generic: you get a default gd_run() already provided. It has a while(1) loop that calls gd_run_body() over and over. It checks for reconifg and terminate events and only acts on them between calls to gd_run_body().
Terminate events will be forced through after $Daemon::Generic::force_quit_delay seconds if gd_run_body() doesn't return quickly enough. periodt. π
πΈ SUBCLASS METHODS REQUIRD πΈ
yes, that heading says REQUIRD β we keep the original spelling, bestie.
The following method is required to be overridden to subclass Daemon::Generic::While1:
gd_run_body()β This method will be called over and over. This method should include a call tosleep(1)(or a bit more). Reconfig events will not interrupt it. Quit events will only interrupt it after 15 seconds.
π ADDITIONAL METHODS π
The following additional methods are available for your use (as compared to Daemon::Generic):
gd_sleep($period)β This will sleep for$periodseconds but in one-second intervals so that if aSIGINTorSIGHUParrives the sleep period can end more quickly.
Using this makes it safe for gd_run_body() to sleep for longer than $Daemon::Generic::force_quit_delay seconds at a time. slay.
π«Ά ADDITIONAL MEMBER DATA π«Ά
The following additional bits of member data are defined:
gd_sigintβ The time at which an (unprocessed)SIGINTwas received.gd_sighupβ The time at which an (unprocessed)SIGHUPwas received.
π LICENSE π
Copyright (C) 2006-2010 David Muir Sharnoff <muir@idiom.com>. Copyright (C) 2011 Google, Inc.
This module may be used and distributed on the same terms as Perl itself. legal bestie moment. π
okay bye bestie β this page is from perl v5.42.0, dated 2017-07-17 πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Daemon-Generic 0.85-bp160.1.11 Β· Artistic-1.0 or GPL-1.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms