Module Rig_bin.Line
The lines a launched process and a machine's half write to their launcher.
A launched process reports on the descriptor RIG_REMOTE_REPORT names: rig.remote writes started, closed and failed WHY; an agent also writes waiting and listening HOST:PORT before them. A machine's half writes rig-agent SESSION first on its session, relays its agent's lines, and adds died CAUSE. Each line ends with a newline; a reason's own newlines are written as spaces.
Used from one thread: readers share one buffer.
Readers
type readerThe type for the lines of a descriptor, read without blocking.
reader fd reads the lines of fd, which it makes non-blocking.
read r is the complete lines fd r has for now, without their newlines. At the end of fd r it closes it, and drops an unfinished line: a process that died while writing reported nothing.