Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my Supply $out-supply = supply {
- my Proc::Async $proc-async .= new(</bin/ls -l>);
- $proc-async.stdout.lines.tap({ say 'forwarding ' ~ $_; emit($_) });
- my Proc $done-proc = await $proc-async.start;
- say 'process exited';
- if $done-proc.exitcode != 0 {
- say 'bad exit code';
- emit(
- Failure.new(
- "Process exited with non-zero exit code: {$done-proc.exitcode}"
- )
- );
- }
- say 'done';
- }
- say 'i have control';
- say $out-supply.list.Array;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement