Skip to main content

wait_until_done

Function wait_until_done 

Source
pub fn wait_until_done(
    child: &mut Child,
    outputs: &[&File],
    patience: Patience,
    quiet: &mut Option<Duration>,
) -> Result<Result<ExitStatus, StopCause>, SingleFlightError>
Expand description

What: Look at a running read-only query until it ends, stalls or floods its output, and say how quiet it got. Why: std has no timed wait, so the parent looks with try_wait, which never blocks; the clock reads the signs of work a few times a second. A query that works is waited for however long it takes: it has no wall-clock bound (owner, 2026-11-03: “Stop only on no progress”; the coordinator’s scope addition to picks 4 and 9 of doc/planning/cli-git-shipped-limits-audit.md, open to the owner’s veto), and on a system that counts nothing it is never judged stalled. quiet receives the longest quiet gap seen, for the ledger, and nothing where the system counts nothing.

In TS you’d write (pseudocode):

await Promise.race([exited, stalled, flood]); // never by elapsed time