Cross-platform Process Spawner (util/spawn.rs)

grok-build · crates/codegen/xai-grok-tools/src/util/spawn.rs · rust · Apache-2.0
infra, fw:tokio, tag:process, tag:reaping

Handles child-process lifecycle for tokio::process::Command with logging and reaping.

// Source: https://github.com/xai-org/grok-build | License: Apache-2.0 | Copyright 2023-2026 SpaceXAI
// Provided via justclaw.it.com; keep this notice with the code.
//! Cross-platform child-process lifecycle helpers for `tokio::process::Command`.
//!
//! The spawn-lifecycle primitives are re-exported from the lightweight
//! [`xai_tty_utils`] crate; this module adds the logging reap wrapper
//! (tracing is unavailable there).

pub use xai_tty_utils::{
    ProcessGroup, ProcessScope, detach_command, detach_search_command, global_process_scope,
    new_process_group,
};

/// Reap an already-killed search child, bounded by
/// [`xai_tty_utils::KILL_REAP_TIMEOUT`]; on `None` warn and leave the corpse
/// to tokio's orphan reaper.
pub async fn reap_killed_search_child(
    child: &mut tokio::

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key