Last active
March 7, 2017 10:49
-
-
Save dogbert17/037f464c4da80a286f9e0895fae63ed9 to your computer and use it in GitHub Desktop.
Dummy code
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
# command with arguments | |
while True { | |
my $proc1 = Proc::Async.new('cat', '/home/dogbert/repos/rakudo/t/spec/S15-nfg/emoji-test.t'); | |
my $proc2 = Proc::Async.new('cat', '/home/dogbert/repos/rakudo/t/spec/S15-nfg/emoji-test.t'); | |
my $proc3 = Proc::Async.new('cat', '/home/dogbert/repos/rakudo/t/spec/S15-nfg/emoji-test.t'); | |
my $proc4 = Proc::Async.new('cat', '/home/dogbert/repos/rakudo/t/spec/S15-nfg/emoji-test.t'); | |
my $proc5 = Proc::Async.new('cat', '/home/dogbert/repos/rakudo/t/spec/S15-nfg/emoji-test.t'); | |
my $proc6 = Proc::Async.new('cat', '/home/dogbert/repos/rakudo/t/spec/S15-nfg/emoji-test.t'); | |
my $proc7 = Proc::Async.new('cat', '/home/dogbert/repos/rakudo/t/spec/S15-nfg/emoji-test.t'); | |
my $proc8 = Proc::Async.new('cat', '/home/dogbert/repos/rakudo/t/spec/S15-nfg/emoji-test.t'); | |
my $proc9 = Proc::Async.new('cat', '/home/dogbert/repos/rakudo/t/spec/S15-nfg/emoji-test.t'); | |
# subscribe to new output from out and err handles: | |
$proc1.stdout.tap(-> $v { } ); | |
$proc2.stdout.tap(-> $v { } ); | |
$proc3.stdout.tap(-> $v { } ); | |
$proc4.stdout.tap(-> $v { } ); | |
$proc5.stdout.tap(-> $v { } ); | |
$proc6.stdout.tap(-> $v { } ); | |
$proc7.stdout.tap(-> $v { } ); | |
$proc8.stdout.tap(-> $v { } ); | |
$proc9.stdout.tap(-> $v { } ); | |
say "Starting..."; | |
my $promise1 = $proc1.start; | |
my $promise2 = $proc2.start; | |
my $promise3 = $proc3.start; | |
my $promise4 = $proc4.start; | |
my $promise5 = $proc5.start; | |
my $promise6 = $proc6.start; | |
my $promise7 = $proc7.start; | |
my $promise8 = $proc8.start; | |
my $promise9 = $proc9.start; | |
sleep 0.1; | |
# wait for the external program to terminate | |
await $promise1, $promise2, $promise3, $promise4, $promise5, $promise6, $promise7, $promise8, $promise9; | |
say "Done."; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment