-
-
Save anonymous/679ba6b9df390e160d74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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