Skip to main content

Module executor

Module executor 

Source
Expand description

Execute commands while continuously draining both process pipes.

Structs§

ExecutionResult
Command execution result.
ProcessHandle
Non-blocking process handle. Pipe readers run immediately after spawning.

Constants§

DEFAULT_KILL_AFTER
Time a process group may keep running after terminate before SIGKILL.
DEFAULT_PIPE_DRAIN
Time the pipes may stay open after the wrapper shell exited.

Functions§

execute_command
Execute a command, or return the command without spawning in dry-run mode.
execute_detached
Start a detached command with all standard streams disconnected, in its own process group (JS spawn(..., { detached: true })).
execute_detached_with_env
Like execute_detached, with an optional explicit child environment.
is_process_group_alive
Whether any process in the group led by pgid is alive.
normalize_exit
Exit code and signal of a status; a signal becomes 128 + N.
setup_signal_handler
Register a Ctrl+C cleanup callback in the current Tokio runtime. Calling the returned function unregisters it without running cleanup.
signal_from_exit_code
Signal named by a shell exit code of 128 + N (137 is SIGKILL).
signal_name
Name of a signal number (9 is SIGKILL).
start_command
Start a command and drain stdout/stderr concurrently, with optional console output.
start_command_with_env
Like start_command, with an explicit child environment that replaces the inherited one (issue #60: values stay off the command line).
start_command_with_stdin
Like start_command, with stdin piped for ProcessHandle::write_stdin (live input, stream-json frames).

Type Aliases§

CleanupFn
Signal cleanup callback.