Nordaaker AS > Parallol > Parallol

Download:
Parallol-0.3.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.3   Source  

NAME ^

Parallol - Because parallel requests should be as fun as parallololololol!

SYNOPSIS ^

  my $p = Parallol->new;
  my $ua = Mojo::UserAgent->new;

  my $titles = {};

  $p->on_done(sub {
    say $titles;
  });

  $ua->get('http://bbc.co.uk/', $p->do(sub {
    $titles->{bbc} = pop->res->dom->at('title')->text;
  }));

  $ua->get('http://mojolicio.us/', $p->do(sub {
    $titles->{mojo} = pop->res->dom->at('title')->text;
  }));

DESCRIPTION ^

Basic action for tracking parallel requests and running callbacks after the last request completes. See Mojolicious::Plugin::Parallel for a more concrete implementation of this technique.

METHODS ^

do

Wrap a request in a callback, and track parallel count.

SEE ALSO ^

Mojolicious, Mojolicious::Plugin::Parallol

AUTHOR

Magnus Holm mailto:magnus@nordaaker.com

LICENSE

This software is licensed under the same terms as Perl itself.

syntax highlighting: