Created
December 19, 2016 14:09
-
-
Save anonymous/4396dc96647322f106ed26a92d9f928c 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
use HTTP::UserAgent; | |
my @promises; | |
my @urls = <duckduckgo.com perl6.org perl6advent.wordpress.com>; | |
for @urls -> $url { | |
@promises.push: start { | |
my $ua = HTTP::UserAgent.new; | |
my $t1 = now; | |
say "Fetching $url"; | |
$ua.get($url); | |
say "$url fetched in {now - $t1}"; | |
} | |
} | |
await Promise.allof(@promises); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment