Skip to main content

Module subprocess

Module subprocess 

Source
Expand description

One child process, run to completion under a deadline and a cancel flag.

The adapter that llm and forgeio share. Both spawn a program that carries its own credentials, feed it bytes, and want its bytes back before a deadline or the moment a reviewer gives up — and neither wants to own the watchdog that makes that safe. This is that watchdog, once.

Threaded i/o on every pipe: a large stdin must not deadlock against a child that writes before it finishes reading, and a large stdout must not fill the pipe while the watchdog waits for exit.

Structs§

Output
The child’s whole output. The status is not judged here: a non-zero exit means one thing to a completion and another to is-ancestor, and the caller knows which it asked for.
Run
What to run and how long to wait for it.

Enums§

Failure
Why there is no output. The command that failed is the caller’s to name, so it is not repeated in here.

Functions§

run
stderr_excerpt
The first limit bytes of stderr as text, for an error message.