Fork::Template(3pm)
π NAME π
okay so bestie, meet AnyEvent::Fork::Template β she literally generates a template process straight out of your main program π§β¨
πΈ SYNOPSIS πΈ
heads up: this is only usable in the main program, no cap.
# only usable in the main program
# preload some harmless modules (just examples)
use Other::Module;
use Some::Harmless::Module;
use My::Worker::Module;
# now fork and keep the template
use AnyEvent::Fork::Template;
# now do less harmless stuff (just examples)
use Gtk2 -init;
my $w = AE::io ...;
# and finally, use the template to run some workers
$AnyEvent::Fork::Template->fork->run ("My::Worker::Module::run_worker", sub { ... });
likeβ¦ preload the cute innocent modules first, then use AnyEvent::Fork::Template to fork and stash the template, then go do the chaotic stuff, and finally let the template cook up your workers. the ordering is the whole vibe, fr fr π
π¦ DESCRIPTION π¦
so by default, this module forks the first time you use it, and it stores the resulting AnyEvent::Fork object in the $AnyEvent::Fork::Template variable. the mnemonic? literally the same name as the module itself, iykyk π
the rules, bestie, and they are not optional: it must only be used in the main program, and only once. periodt.
other than that, the only requirement is that you can handle the results of a fork at that time β meaning if you use this module after AnyEvent has been initialised, or after you've opened some window with Gtk2 or Tk for example, then you can't easily use these modules in the forked process. so choosing where to use this module is key. choose wisely, main character π
and like, real talk: there is never a need for this module β you can always create a new empty process and load the modules you need into it. it's giving convenience, not necessity π
π AUTHOR π
- Marc Lehmann <schmorp@schmorp.de>
- http://home.schmorp.de/
and that's the whole page, bestie π«Ά this was Fork::Template(3pm) from the User Contributed Perl Documentation collection, running on perl v5.32.1 and dated 2022-01-29 β go forth and fork responsibly, you absolute icon βπ
π¦ where this page comes from
- debian bookworm: libanyevent-fork-perl 1.32-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libanyevent-fork-perl 1.32-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libanyevent-fork-perl 1.32-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libanyevent-fork-perl 1.32-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libanyevent-fork-perl 1.32-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libanyevent-fork-perl 1.32-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms