Daemon:...AnyEvent(3)

✨ NAME ✨

okay bestie, this is the User Contributed Perl Documentation page for Daemon:...AnyEvent(3) πŸ’– and the module is Daemon::Generic::AnyEvent β€” literally a generic daemon framework with AnyEvent.pm 🌸.


πŸ¦‹ SYNOPSIS πŸ¦‹

        use Daemon::Generic::AnyEvent;
        use Some::Event::Loop::Supported::By::AnyEvent;

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

        sub gd_preconfig {
               # stuff
        }

πŸ’… DESCRIPTION πŸ’…

Daemon::Generic::AnyEvent is a subclass of Daemon::Generic that predefines some methods, and honestly? iconic behavior πŸ‘‘.

  • 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().

bestie, fr fr: no sleep() in gd_run_body() here πŸ’€

πŸŽ€ 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 whole vibe was brought to you by perl v5.42.0, dated 2017-07-17, and it's the Daemon:...AnyEvent(3) page β€” slay πŸ’…βœ¨

πŸ“¦ where this page comes from