Expand description
The handle a caller holds for one running exec.
The whole reason this module exists is ExecHandle::stream. Everything else here
is a thin wrapper over one route.
§The cursor is the contract
A reconnect passes ?offset=<bytes consumed>, and the daemon replays from there.
Without it a dropped connection means either losing everything after the drop or
replaying from zero, and neither is distinguishable from correct behaviour with
nothing to check against — E2B’s cursorless connect(pid) and their issue #1352 are
exactly that.
Two rules the cursor arithmetic has to obey, and both are properties of what the caller has seen rather than of what arrived:
- Advance only past bytes actually handed to the caller, so a reconnect never re-delivers and never skips.
- Advance past a
gaptoo. The daemon has already moved its own cursor past evicted bytes; if ours did not follow, a reconnect would ask for them again and be told about the same gap forever.
§The reconnect condition is a typed event, not a byte count
A stream that ended without an exit event was cut. A stream that ended with one
is over. Those two are the identical byte sequence on a raw stream, which is the
whole argument for SSE framing here and why this is not a byte stream. The
reconnect decision reads that distinction and nothing else.
Structs§
- Exec
Handle - One exec, addressed by its caller-minted id.
- Exec
Result - An exec’s phase and, once it has one, its outcome.
- Stream
End - Why a stream stopped, and where a resume would pick up.
- Stream
Options - How a stream should behave. See
ExecHandle::stream_with.
Enums§
- EndReason
- The three ways a stream ends without an error.
Constants§
- DEFAULT_
STREAM_ IDLE_ TIMEOUT - How long an attached stream may be silent before it is treated as dead.
Functions§
- mint_
exec_ id - A fresh exec id:
x-plus 16 hex characters, the Python client’s shape.
Type Aliases§
- Stdin
Ack - What a stdin write accomplished.