Proc::ForkSafe(3pm)

πŸ“¦
version 0.001 Β· 4 versions
, in epel 10

πŸ’– 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 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