Skip to content

RunningCommandHandle

Category: Core

Source: running_command_handle.dart

An abstract handle to a running command in a runtime.

Implementations live in the strategies layer (e.g. process-backed RunningCommand for host/Docker, HTTP-backed handles for cloud runtimes). Consumers in the harness (ShellJobManager) depend only on this interface so they can manage background jobs uniformly regardless of where the command actually runs.

Classes

abstract RunningCommandHandle

An abstract handle to a running command in a runtime.

Implementations live in the strategies layer (e.g. process-backed RunningCommand for host/Docker, HTTP-backed handles for cloud runtimes). Consumers in the harness (ShellJobManager) depend only on this interface so they can manage background jobs uniformly regardless of where the command actually runs.

Properties

PropertyTypeDescription
stdoutStream<List<int>> getStdout bytes from the running command.
stderrStream<List<int>> getStderr bytes from the running command.
exitCodeFuture<int> getResolves with the process exit code once the command finishes.
stdoutStream<List<int>> getStdout bytes from the running command.
stderrStream<List<int>> getStderr bytes from the running command.
exitCodeFuture<int> getResolves with the process exit code once the command finishes.

Methods

Future<void> kill({bool force = false})

Terminates the running command.

With [force] false (default), sends a polite signal (SIGTERM / graceful cancel). With [force] true, escalates to an immediate kill (SIGKILL / hard-stop). The shutdown path typically calls [kill] once politely, waits briefly, then calls [kill] with force: true for any commands still alive.

Released under the MIT License.