-
-
Save ugexe/ab6ca0453900cc0c746d 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
method start-processes { | |
my $p = Promise.new; | |
$p.keep(1); | |
for @!processes -> $level { | |
my @not-started := $level.list.grep({ !$_.started }); | |
$p = $p.then: { | |
my @promises := @not-started.map: { $_.start } | |
await Promise.allof(@promises) if @promises; | |
} | |
} | |
$p; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment