-
-
Save Altai-man/ca5412b2f454d50d1556a3005a895ac1 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
react { | |
my $batch-size = $*KERNEL.cpu-cores; | |
my @queue = eager 0..10; # Populate your jobs data here | |
sub do-one { | |
with @queue.shift -> $el { | |
my $proc = Proc::Async.new(...); | |
whenever $proc.out -> $output { | |
...processing $output... | |
} | |
whenever $proc.start -> $exit { | |
...some post-processing...; | |
do-one(); | |
} | |
} | |
} | |
do-one for ^$batch-size; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment