-
-
Save ugexe/118f826fa96ec131b711d23762dd1df6 to your computer and use it in GitHub Desktop.
Proc input size not matching output size?
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
my $proc = run «cat -», :in, :out, :bin; | |
say "started"; | |
my $input = ("a" x 1000000).encode; | |
say "input total: {$input.bytes}"; | |
my $promise = start { | |
$proc.in.write: $input; | |
say "input written"; | |
$proc.in.close; | |
say "input closed"; | |
} | |
my $total; | |
$proc.out.Supply.act: {say "Got {.bytes} bytes"; $total += .bytes} | |
await $promise; | |
$proc.out.close; | |
say "Bytes received: $total"; | |
say "Exit code: {$proc.exitcode}"; |
Author
ugexe
commented
Jun 17, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment