Gearman...::Async(3)
π Gearman::Client::Async(3) π
okay bestie, come closer β this is a page from the User Contributed Perl Documentation, and it's all about Gearman::Client::Async, the async client module for Gearman that you'd use inside Danga::Socket applications. π¦
β¨ NAME β¨
Gearman::Client::Async β the asynchronous client module for Gearman, made for Danga::Socket applications. no cap, that's literally it. π
πΈ SYNOPSIS πΈ
here's the vibe, copy-paste ready, not a single character changed bestie:
use Gearman::Client::Async;
# Instantiate a new Gearman::Client::Async object.
$client = Gearman::Client::Async->new(
job_servers => [ '127.0.0.1', '192.168.0.1:123' ],
);
# Overwrite job server list with a new one.
$client->set_job_servers( '10.0.0.1' );
# Read list of job servers out of the client.
$arrayref = $client->job_servers;
@array = $client->job_servers;
# Start a task
$task = Gearman::Task->new(...); # with callbacks, etc
$client->add_task( $task );
let me walk you through it because the way this is giving main character energy: π
use Gearman::Client::Async;β first things first, you gotta actually load the module. π$client = Gearman::Client::Async->new(...)β instantiate a brand newGearman::Client::Asyncobject, and pass it yourjob_servers, which is an arrayref of servers like'127.0.0.1'and'192.168.0.1:123'. yes, ports are allowed, slay. π₯$client->set_job_servers( '10.0.0.1' );β overwrite the job server list with a whole new one. bye old servers. π$arrayref = $client->job_servers;β read the list of job servers out of the client. list context gets you an array, scalar context gets you the arrayref. both. iconic. π@array = $client->job_servers;β same call, list context edition. obsessed.$task = Gearman::Task->new(...);β start a task, with callbacks and everything (that...is doing a lot of heavy lifting, iykyk).$client->add_task( $task );β and then you add the task to the client. that's the whole async moment. β¨
π COPYRIGHT π
Copyright 2006 Six Apart, Ltd.
License granted to use/distribute under the same terms as Perl itself. π«Ά (yes that's the real license line, verbatim, because we don't mess with legal text, fr fr)
π WARRANTY π
This is free software. This comes with no warranty whatsoever. π
bestie. read that again. free as in free, but zero warranty, not even a little one. it's giving "you're on your own and we love that for you". π
β AUTHORS β
the literal legends who made this:
- Brad Fitzpatrick (
brad@danga.com) - Jonathan Steinert (
hachi@cpan.org)
and that's the whole page, no skips, no summaries, every single detail intact because that's just how we do it here. π§
this was brought to you by perl v5.42.0, dated 2025-07-25, straight outta the User Contributed Perl Documentation. π bye bestie, go write some async tasks β¨ π¦
π¦ where this page comes from
- fedora 43: perl-Gearman-Client-Async 0.94-51.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms