Proc::ForkSafe(3pm)
π Proc::ForkSafe(3pm) π
okay so this is Proc::ForkSafe(3pm), straight out of User Contributed Perl Documentation β letβs get into it, bestie π
β¨ NAME β¨
Proc::ForkSafe β help make objects fork safe π«Ά
πΈ SYNOPSIS πΈ
hereβs the whole vibe, commands and all:
use Proc::ForkSafe;
package MyPersistentTCPClient {
sub new {
...
}
sub request {
...
}
}
my $client = Proc::ForkSafe->wrap(sub { MyPersistentTCPClient->new });
my $res = $client->call(request => @some_argv);
my $pid = fork // die;
if ($pid == 0) {
# in child process, $client will be reinitialized
my $res2 = $client->call(request => @some_argv);
...
exit;
}
waitpid $pid, 0;
π¦ DESCRIPTION π¦
Proc::ForkSafe helps make objects fork safe. thatβs the whole point, and honestly? iconic behavior β¨
π COPYRIGHT AND LICENSE π
Copyright 2023 Shoichi Kaji <skaji@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
okay thatβs the page, bestie π«Ά β cute little footer shoutout: source/version is perl v5.40.2, dated 2025-01-18. bye! π
π¦ where this page comes from
- epel 10: perl-Proc-ForkSafe 0.001-5.el10_1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms