Skip to content

Instantly share code, notes, and snippets.

/-

Created February 2, 2016 07:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/679ba6b9df390e160d74 to your computer and use it in GitHub Desktop.
Save anonymous/679ba6b9df390e160d74 to your computer and use it in GitHub Desktop.
@urls = (
'http://cnn.com',
'http://foxnews.com'
);
my $delay = Mojo::IOLoop->delay(sub {
my ($delay, $mojo, $minion) = @_; # Figure this magic voodoo out...
say $mojo->req->url . " -> " . $mojo->res->code;
});
$delay->on(finish => sub {
say "All urls downloaded";
});
$ua->get( $_ => $delay->begin) for @urls;
$delay->wait;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment