Skip to content

Instantly share code, notes, and snippets.

@ugexe

ugexe/test.pl6 Secret

Last active November 18, 2016 19:03
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 ugexe/b13730923b257f37e224a4eabb1e2db6 to your computer and use it in GitHub Desktop.
Save ugexe/b13730923b257f37e224a4eabb1e2db6 to your computer and use it in GitHub Desktop.
use v6;
use Net::HTTP::GET;
my Str @urls = "https://www.google.com",
"https://www.yahoo.com",
"https://www.microsoft.com";
await Promise.allof: @urls.map: {
sleep $++;
start {
say "---> Making requst to $_";
my $res = Net::HTTP::GET($_);
say "<--- Got response from $_ with status code: {$res.status-code}";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment