Skip to main content

Module host

Module host 

Source
Expand description

Host programs as process groups, with streamed output and an exit that reports its signal.

This is the host process primitive of the participant backends.

A HostProcess leads a process group, so it and its descendants can be signalled together. Its output is an OutputStream of what the program writes to its standard output and error, and its exit is a watch that holds how the program exited once it has. The pipes stay read until they close, even when the stream is dropped, so a program is never blocked or signalled by its observer going away. Stopping sends SIGTERM to the group, then SIGKILL after a grace. Dropping a process sends SIGKILL to its group.

Structs§

HostCommand
A program to run.
HostExit
How a program exited.
HostProcess
A running program and its process group.

Type Aliases§

ExitWatch
Holds None while the program runs, then how it exited, or why that cannot be told.