Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

tokuhirom (7396)

tokuhirom
  (email not shown publicly)
http://d.hatena.ne.jp/tokuhirom/

Journal of tokuhirom (7396)

Sunday May 06, 2007
05:56 AM

Gearman::Taskset::Async

[ #33207 ]

I wrote Gearman::Taskset::Async, the Gearman asynchronous taskset.

for example:
        use Gearman::Client;
        use Gearman::Taskset::Async;
        my $client = Gearman::Client->new(job_servers => ['127.0.0.1']);
        my $ts = $client->new_async_task_set;
        for (1..1000) {
                $ts->add_task("echo" => \$_, +{on_complete => sub {
                        warn "COMPLETED";
                        warn "@_";
                }, on_fail => sub {
                        warn "FAILED";
                }});
        }
        $ts->run;

Gearman has asynchronous client(Gearman::Client::Async), is based on Danga::Socket.Danga::Socket imcompatible with mod_perl, because that uses class variables.

source code is here: Gearman::Taskset::Async

oops. It's just a Gearman::Taskset::BulkBlocRequest?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.