GitHub

ChildProcessHandle

API reference for ChildProcessHandle.

A running child process; the constructor is Effect's makeHandle.

  • exit_code: waits for the exit; fails if a signal ended the process, or with the error of a stream feeding one of its inputs.
  • stdin: a sink writing standard input; text is encoded with the command's StdinConfig.encoding.
  • stdout, stderr: byte streams of its output; all both, interleaved. Reading one alongside all splits the output between them.
  • get_input_fd / get_output_fd: an additional descriptor's sink or stream (a draining sink and an empty stream for one not set up).
  • unref: stop the scope from killing the process when it closes; the Reref it gives back undoes that.

Attributes

AttributeTypeDescription
pidProcessId
exit_codeEffect[ExitCode, PlatformError]
is_runningEffect[bool, PlatformError]
killKill
stdinSink[None, bytes | str, Never, PlatformError]
stdoutStream[bytes, PlatformError]
stderrStream[bytes, PlatformError]
allStream[bytes, PlatformError]
get_input_fdCallable[[int], Sink[None, bytes, Never, PlatformError]]
get_output_fdCallable[[int], Stream[bytes, PlatformError]]
unrefEffect[Reref, PlatformError]

Functions

__init__

__init__(*, pid, exit_code, is_running, kill, stdin, stdout, stderr, all, get_input_fd, get_output_fd, unref) -> None
ParameterTypeDescription
pidProcessId
exit_codeEffect[ExitCode, PlatformError]
is_runningEffect[bool, PlatformError]
killKill
stdinSink[None, bytes | str, Never, PlatformError]
stdoutStream[bytes, PlatformError]
stderrStream[bytes, PlatformError]
allStream[bytes, PlatformError]
get_input_fdCallable[[int], Sink[None, bytes, Never, PlatformError]]
get_output_fdCallable[[int], Stream[bytes, PlatformError]]
unrefEffect[Reref, PlatformError]