txt: ## tapbeforespawn.md
  class X::Proc::Async::TapBeforeSpawn
  
  Error due to tapping a Proc::Async stream after spawning its process
  
  ```raku
  class X::Proc::Async::TapBeforeSpawn is Exception {}
  ```
  
  If the `stdout` or `stderr` methods of [`Proc::Async`](/type/Proc/Async) are called after the program has been `start`ed, an exception of type `X::Proc::Async::TapBeforeSpawn` is thrown.
  
  ```raku
  my $proc = Proc::Async.new("echo", "foo");
  $proc.start;
  $proc.stdout.tap(&print);
  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
  
  ```raku
  my $proc = Proc::Async.new("echo", "foo");
  $proc.stdout.tap(&print);
  await $proc.start;
  ```
  
  # [Methods](#class_X::Proc::Async::TapBeforeSpawn "go to top of document")[§](#Methods "direct link")
  
  ## [method handle](#class_X::Proc::Async::TapBeforeSpawn "go to top of document")[§](#method_handle "direct link")
  
  ```raku
  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.
  