Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Document X::Proc::Async::CharsOrBytes
- Loading branch information
Showing
2 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| =begin pod | ||
| =TITLE class X::Proc::Async::CharsOrBytes | ||
| =SUBTITLE Exception class for L<Proc::Async>, thrown when an output stream is tapped for both text and binary data. | ||
| class X::Proc::Async::CharsOrBytes is Exception { ... } | ||
| A L<Proc::Async> object allows subscription to the output or error stream | ||
| either for bytes (L<Blob|/type/Blob>) or for text data (L<Str|/type/Str>), but | ||
| not for both. If you do try both, it throws an exception of type | ||
| C<X::Proc::Async::CharsOrBytes>. | ||
| my $proc = Proc::Async.new('echo'); | ||
| $proc.stdout.tap(&print); | ||
| $proc.stdout(:bin).tap(&print); # dies with | ||
| # Can only tap one of chars or bytes supply for stdout | ||
| =head1 Methods | ||
| =head2 method handle | ||
| method handle(X::Proc::Async::CharsOrBytes:D:) returns Str:D | ||
| Returns the name of the handle that was accessed both for text and for binary | ||
| data, C<stdout> or C<stderr>. | ||
| =end pod |