Gearman::Taskset(3pm)
π Gearman::Taskset π
okay bestie, welcome to Gearman::Taskset(3pm) β it's part of the User Contributed Perl Documentation and it's genuinely one of those little modules that just works, no cap. It's the taskset in Gearman, seen from the point of view of a Gearman::Client. π
β¨ NAME β¨
Gearman::Taskset β a taskset in Gearman, from the point of view of a Gearman::Client. π¦
πΈ SYNOPSIS πΈ
here's the vibe, literally copy-paste it and go:
use Gearman::Client;
my $client = Gearman::Client->new;
# waiting on a set of tasks in parallel
my $ts = $client->new_task_set;
$ts->add_task( "add" => "1+2", {...});
$ts->wait();
the {...} is doing a lot of heavy lifting there but she's iconic for it π
π DESCRIPTION π
Gearman::Taskset is a Gearman::Client's representation of tasks queue. that's it, that's the whole job, and she eats every time. π₯
π§ METHODS π§
new($client)
make a new one, pass her the client, we move. β¨
wait(%opts)
waits for a response from the job server for any of the tasks listed in the taskset. lowkey the main character of this whole module tbh.
it will call the on_* handlers for each of the tasks that have been completed, updated, etc. β like, every single one that has something to say gets its moment. π
and she does not return until everything has finished running or failing. no early exits, no half-finished energy. periodt. π
add_task(Gearman::Task)
add_task($func, <$scalar | $scalarref>, <$uniq | $opts_hr>
adds a task to the taskset. π«Ά
three different calling conventions are available, so pick your fighter and slay.
for $opts_hr see Gearman::Task. iykyk. π
ngl bestie, the way that wait just stays there until every last task is done running or failing? that's commitment. that's loyalty. that's the vibe check passing. π
and that's the whole page, you're so welcome πΈ
this little beauty ships as perl v5.26.2, dated 2018-08-30, in the Gearman::Taskset(3pm) manpage β so go forth, queue your tasks in parallel, and be the main character of your own event loop. π
β¨π¦
π¦ where this page comes from
- debian bookworm: libgearman-client-perl 2.004.015-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgearman-client-perl 2.004.015-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libgearman-client-perl 2.004.015-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgearman-client-perl 2.004.015-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgearman-client-perl 2.004.015-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