Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mostly finish documenting Proc::Async
  • Loading branch information
moritz committed Jan 25, 2015
1 parent c9d67d3 commit 3b83fb1
Showing 1 changed file with 49 additions and 3 deletions.
52 changes: 49 additions & 3 deletions lib/Type/Proc/Async.pod
Expand Up @@ -132,10 +132,56 @@ L<X::Proc::Async::OpenForWriting> exception will the thrown.
C<start> must have been called before calling method write, otherwise an
L<X::Proc::Async::MustBeStarted> exception is thrown.
=begin comment
=head2 method print
TODO: various exceptions, print, say, close-stdin, kill
method print(Proc::Async:D: Str(Any) $str, :$scheduler = $*SCHEDULER)
=end comment
Write the text data in C<$str> to the standard input stream of the external
program, encoding it as UTF-8.
The C<Proc::Async> object must be created for writing (with
C<Proc::Async.new(:w, $path, @args)>). Otherwise an
L<X::Proc::Async::OpenForWriting> exception will the thrown.
C<start> must have been called before calling method print, otherwise an
L<X::Proc::Async::MustBeStarted> exception is thrown.
=head2 method say
method say(Proc::Async:D: Str(Any) $str, :$scheduler = $*SCHEDULER)
Write the text data in C<$str> and a newline to the standard input stream of the external
program, encoding it as UTF-8.
The C<Proc::Async> object must be created for writing (with
C<Proc::Async.new(:w, $path, @args)>). Otherwise an
L<X::Proc::Async::OpenForWriting> exception will the thrown.
C<start> must have been called before calling method say, otherwise an
L<X::Proc::Async::MustBeStarted> exception is thrown.
=head2 method close-stdin
method close-stdin(Proc::Async:D:)
Closes the standard input stream of the external program. Programs that read
from STDIN often only terminate when their input straem is closed. so if
waiting for the promise from C<#method start> hangs (for a program opened for
writing), it might be a forgotten C<close-stdin>.
The C<Proc::Async> object must be created for writing (with
C<Proc::Async.new(:w, $path, @args)>). Otherwise an
L<X::Proc::Async::OpenForWriting> exception will the thrown.
C<start> must have been called before calling method close-stdin, otherwise an
L<X::Proc::Async::MustBeStarted> exception is thrown.
=head2 method kill
kill(Proc::Async:D: $signal = "HUP")
Sends a signal to the running program. The signal cann be a signal name
("KILL" or "SIGKILL"), an integer (9) or an element of the C<Signal> enum
(Signal::SIGKILL).
=end pod

0 comments on commit 3b83fb1

Please sign in to comment.