Skip to main content

run_with_timeout_default

Function run_with_timeout_default 

Source
pub fn run_with_timeout_default(
    command: &str,
    args: &[&str],
    timeout: Duration,
) -> SysprimsResult<TimeoutOutcome>
Expand description

Run a command with timeout using default configuration.

Equivalent to run_with_timeout(command, args, timeout, TimeoutConfig::default()).

Default configuration:

  • Signal: SIGTERM
  • Kill after: 10 seconds
  • Grouping: GroupByDefault
  • Preserve status: false

ยงExamples

use std::time::Duration;
use sysprims_timeout::run_with_timeout_default;

// Replaces: timeout 2s sleep 1
let _ = run_with_timeout_default("sleep", &["1"], Duration::from_secs(2));