Skip to content

Instantly share code, notes, and snippets.

@smls
Created October 14, 2016 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smls/75518c746ca65b3287482c491971eac0 to your computer and use it in GitHub Desktop.
Save smls/75518c746ca65b3287482c491971eac0 to your computer and use it in GitHub Desktop.
my $proc = run «cat -», :in, :out, :bin;
say "started";
my $input = ("a" x 1000000).encode;
say "input encoded";
my $promise = start {
$proc.in.write: $input;
say "input written";
$proc.in.close;
say "input closed";
}
say $proc.out.slurp-rest(:close, :bin).bytes;
say "output read";
await $promise;
say "all done";
started
input encoded
input written
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment