pub struct OsSubprocessRuntime { /* private fields */ }Expand description
Default implementation using std::process::Command.
Implementations§
Source§impl OsSubprocessRuntime
impl OsSubprocessRuntime
Sourcepub fn with_timeout(timeout_secs: u64) -> Self
pub fn with_timeout(timeout_secs: u64) -> Self
Create a new OS subprocess runtime with the given wall-clock timeout.
If the subprocess does not complete within timeout_secs seconds the
call returns a SubprocessError with a “timed out” message. The
spawned process is left for the OS to reap — it is not explicitly
killed.
§Stdin size caveat
Stdin data is written synchronously before the timeout poll loop begins.
If the subprocess hangs before consuming stdin and the data exceeds the
OS pipe buffer (~64 KiB on Linux), run_command will block in the write
phase and the timeout will not fire. For typical Perl source files this
is not a concern.
§Panics
Panics if timeout_secs is zero (a zero-second timeout would time out
every command immediately and is almost certainly a caller bug).