Skip to content

Commit e268569

Browse files
committed
Show how to get a PID from .ready
This example is already overcomplicated, so adding more stuff to it is a bad idea. Still, demonstrating how to get a pid is useful, so we have to show it (but maybe this example has to be split in two).
1 parent d93e58f commit e268569

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/Type/Proc/Async.pod6

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ react {
2828
whenever $proc.stderr { # chunks
2929
say ‘stderr: ’, $_
3030
}
31+
whenever $proc.ready {
32+
say ‘PID: ’, $_ # Only in Rakudo 2018.04 and newer, otherwise Nil
33+
}
3134
whenever $proc.start {
3235
say ‘Proc finished. Exit code: ’, .exitcode;
3336
done # gracefully jump from the react block

0 commit comments

Comments
 (0)