Expand description
Streaming exec engine: a running command in a sailbox with live output.
ExecProcess::start opens a server-streaming exec request. The first frame
reports that the command has started (carrying the durable
exec_request_id); chunk frames carry live stdout/stderr; a terminal frame
carries the result. The command is detached on the server, so dropping the
handle never kills it.
A background pump task drains the stream into two drop-oldest ring buffers
that synchronous readers (StreamReader) pull from. If the stream breaks
mid-run, the pump reconnects with the same idempotency key and the per-stream
seqs it last saw, so the guest replays only the unseen tail. Only when the
stream cannot be resumed does ExecProcess::wait fall back to fetching the
authoritative buffered result. Stdin rides a separate offset-idempotent unary
request, independent of the output stream.
Structs§
- Async
Stream Reader - An async cursor over one live output stream, the awaiting counterpart of
StreamReader.AsyncStreamReader::nextyields the next chunk without parking a runtime thread, so many streams can be read on one event loop. - Exec
Options - Optional settings for
Sailbox::execandSailbox::exec_shell.Defaultruns a plain foreground command (no pty, no stdin, no timeout) and retries transient failures against a waking or migrating sailbox for 30 seconds (seeretry_timeout). - Exec
Process - A handle to a running command. Drop or
ExecProcess::closereleases the stream without killing the command. - Exec
Result - The buffered result of a finished exec.
- Stream
Reader - A cursor over one live output stream.
StreamReader::nextblocks up to a timeout for the next chunk.
Enums§
- Cancel
Signal - Which signal to send when cancelling a running exec.
- Output
Stream - Which output stream a chunk or reader belongs to.
- Read
Step - One step of reading a live output stream.
- Retry
Budget - How long to keep retrying transient RPCs against a waking or migrating sailbox before giving up.