Parall...s::App(3pm)
π Parallel::Pipes::App β your friendly lil wrapper
okay so this is the Parallel::Pipes::App(3pm) page from the User Contributed Perl Documentation section, and honestly? it's giving "I made parallel processing not scary" and I'm obsessed π«Ά
β¨ NAME β¨
Parallel::Pipes::App β a friendly interface for Parallel::Pipes π
π¦ SYNOPSIS π¦
bestie, look how easy this is:
use Parallel::Pipes::App;
my @result = Parallel::Pipes::App->map(
num => 3,
work => sub { my $task = shift; $task * 2 },
tasks => [1, 2, 3, 4, 5],
);
# @result is ( 2, 4, 6, 8, 10 )
likeβ¦ that's it. that's the whole vibe check. β¨
πΈ DESCRIPTION πΈ
Parallel::Pipes::App provides friendly interfaces for Parallel::Pipes. no gatekeeping, no cap, it just hands you the nice version π
π METHODS π
Parallel::Pipes::App provides 2 class method:
lowkey iconic that there's only two. fewer things to remember, more brain cells for you π§
π map
my @result = Parallel::Pipes::App->map(
num => $num,
work => $work,
tasks => \@task,
);
So it processes @task by $work in $num pre-forked child processes, and you get @result back. This is almost the same as:
my @result = map { $work->($_) } @task;
except β and this is the main character detail β $work gets executed in a child process, not in the current process. that's the whole point, that's the slay π₯
π run
Parallel::Pipes::App->run(
num => $num,
work => $work,
tasks => \@task,
before_work => $before_work,
after_work => $after_work,
);
run is the more generic form of map. like, the bigger sister method. In fact, we can write map by using run:
my @result;
Parallel::Pipes::App->run(
num => $num,
work => $work,
tasks => \@task,
before_work => sub {},
after_work => sub { push @result, $_[0] },
);
see what they did there?? map is literally just run wearing a cute outfit π
iykyk
π AUTHOR π
Shoichi Kaji <skaji@cpan.org> β king behavior, ngl π
π COPYRIGHT AND LICENSE π
Copyright 2016 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.
fr fr that's the standard Perl license deal, no surprises, no drama π
okay bye bestie, go parallelize something πβ¨ this page was perl v5.40.2, dated 2025-06-10 β mwah, take care of yourself and your file descriptors π¦π
π¦ where this page comes from
- epel 10: perl-Parallel-Pipes 0.201-1.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