Skip to main content

stream_exec_cancellable

Function stream_exec_cancellable 

Source
pub async fn stream_exec_cancellable<C, F>(
    codex: &Codex,
    cmd: &ExecCommand,
    cancel: C,
    handler: F,
) -> Result<()>
where C: Future<Output = ()> + Send, F: FnMut(JsonLineEvent),
Expand description

Stream JSONL events until the command completes or cancel resolves.

Cancellation terminates the owned process group, waits through the client’s configured grace period, and reaps the direct child before returning Error::Cancelled.