Skip to main content

Module exec

Module exec 

Source
Expand description

A running command in a Sailbox with live output.

ExecProcess::start launches a command and returns a handle right away, carrying its durable exec_request_id. The command runs detached, so dropping the handle never kills it. Read stdout and stderr live through StreamReader, write to stdin, and call ExecProcess::wait for the exit result. Output and the exit status survive a dropped connection: the handle resumes the live output where it left off, or falls back to the buffered result, so a caller never loses the tail.

Structs§

AsyncStreamReader
An async cursor over one live output stream, the awaiting counterpart of StreamReader. AsyncStreamReader::next yields the next chunk without parking a runtime thread, so many streams can be read on one event loop.
ExecOptions
Optional settings for Sailbox::exec and Sailbox::exec_shell. Default runs a plain foreground command (no pty, no stdin, no timeout) and retries transient failures against a waking or migrating Sailbox for ten minutes (see retry_timeout).
ExecProcess
A handle to a running command. Drop or ExecProcess::close releases the stream without killing the command.
ExecResult
The buffered result of a finished exec.
RunOptions
Optional settings for Sailbox::run and Sailbox::run_shell: the ExecOptions subset that applies to a buffered one-shot run (no pty, no stdin, no background).
StreamReader
A cursor over one live output stream. StreamReader::next blocks up to a timeout for the next chunk.

Enums§

CancelSignal
Which signal to send when cancelling a running exec.
ForwardEvent
A local-forwarding request the guest sends for an interactive session, consumed by the shell driver to act on the user’s machine.
OutputStream
Which output stream a chunk or reader belongs to.
ReadStep
One step of reading a live output stream.
RetryBudget
How long to keep retrying transient RPCs against a waking or migrating Sailbox before giving up.

Constants§

EXEC_CANCEL_RETRY
Retry budget for the cancel RPC against a box that may be waking or migrating: the saild registration gap makes cancel forwards return Unavailable for up to ~1s, so retrying within this budget lets the signal still land. Distinct from the exec’s run-retry budget (which wait uses) and from the command’s timeout (a server-enforced kill). One value for every surface so Ctrl-C behaves the same across the SDKs and CLI.