Daemon:...::Event(3)

πŸ’… NAME πŸ’…

okay so this page is Daemon:...::Event(3) from the User Contributed Perl Documentation collection, and it's all about Daemon::Generic::Event β€” a generic daemon framework with Event.pm. slay.

✨ SYNOPSIS ✨

bestie, the setup looks like this:

use Daemon::Generic::Event;

@ISA = qw(Daemon::Generic::Event);

sub gd_preconfig {
       # stuff
}

🌸 DESCRIPTION 🌸

Daemon::Generic::Event is a subclass of Daemon::Generic that predefines some methods, and honestly? iconic:

  • gd_run() β€” sets up a periodic callback to gd_run_body() if there is a gd_run_body(). Then it calls Event::loop().
  • gd_setup_signals() β€” binds SIGHUP to call gd_reconfig_event(). Binds SIGINT to call gd_quit_event().

To use Daemon::Generic::Event, you have to provide a gd_preconfig() method. It can be empty if you have a gd_run_body().

Set up your own events in gd_preconfig() and gd_postconfig().

If you have a gd_run_body() method, it will be called once per second β€” or every gd_interval() seconds if you have a gd_interval() method. Unlike in Daemon::Generic::While1, gd_run_body() should not include a call to sleep(). no cap, leave the sleeping to the framework πŸ’…

πŸŽ€ 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.


okay bye bestie 🫢 this page was served by perl v5.42.0, dated 2017-07-17. periodt ✨

πŸ“¦ where this page comes from