pub fn run_bounded_query(
command: Command,
arguments: &str,
window: Duration,
grace: Duration,
environment: &[(OsString, OsString)],
) -> Result<QueryOutput, SingleFlightError>Expand description
What: Run a query command to its end, or until it has shown no sign of work for the quiet window. Why: Both streams go to anonymous files, so no reader thread can outlive a stopped query. A query that was stopped for being quiet is a coordination failure, not an answer.
In TS you’d write (pseudocode):
async function runBoundedQuery({ command, arguments, windowMs, graceMs }): Promise<QueryOutput>;