Skip to content

Instantly share code, notes, and snippets.

@titsuki
Created December 5, 2016 15:53
Show Gist options
  • Save titsuki/676c9ad9cd82c962b59e80dbcd94e93b to your computer and use it in GitHub Desktop.
Save titsuki/676c9ad9cd82c962b59e80dbcd94e93b to your computer and use it in GitHub Desktop.
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