Skip to content

Instantly share code, notes, and snippets.

@zoffixznet

zoffixznet/p6.p6 Secret

Created April 24, 2018 01:27
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 zoffixznet/cb002b086ded5fde2e10f3ad9057c094 to your computer and use it in GitHub Desktop.
Save zoffixznet/cb002b086ded5fde2e10f3ad9057c094 to your computer and use it in GitHub Desktop.
my @l;
react {
my $p := Proc::Async.new: $*EXECUTABLE, '-e', 「
for ^100000 { 42.note; 100.say }
」;
whenever $p.stdout.lines {
sleep 2 unless $++; say "$_ $*THREAD.id()"; @l.push: $_
}
whenever $p.stderr.lines {
say "$_ $*THREAD.id()"; @l.push: $_
}
whenever $p.start {}
}
say @l;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment