class X::Proc::Async::TapBeforeSpawn is Exception {}

If the stdout or stderr methods of Proc::Async are called after the program has been started, an exception of type X::Proc::Async::TapBeforeSpawn is thrown.

my $proc ="echo""foo");
CATCH { default { put .^name''.Str } };
# OUTPUT: «X::Proc::Async::TapBeforeSpawn: To avoid data races, you must tap stdout before running the process␤»

The right way is the reverse order

my $proc ="echo""foo");
await $proc.start;


method handle§

method handle(X::Proc::Async::TapBeforeSpawn:D: --> Str:D)

Returns the name of the handle (stdout or stderr) that was accessed after the program started.