Created
December 5, 2016 15:53
-
-
Save titsuki/676c9ad9cd82c962b59e80dbcd94e93b 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 Inline::Perl5; | |
my @p5 = Inline::Perl5.new xx 10; | |
my @promises = @p5.list.kv.map: -> $i, $p5 { | |
start { | |
$p5.run(q' | |
sleep $i; | |
print "hello world: $i","\n"; | |
$i; | |
'); | |
} | |
}; | |
say "awaiting"; | |
say [+] await @promises; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment