Skip to content

SpawnOptions

How a spawn should behave: the exec’s own options, plus the stream’s.

Nested rather than flattened onto [ExecOptions], and the reason is that the two sets are answered by different people. cwd/env/user describe the child and are what a caller composing a command supplies; offset/reconnect/gapPolicy describe how this client reads the child’s output and are what a caller composing a resume supplies. Flattening them would put maxReconnects next to user in one bag, which is where a caller reaches for the wrong one.

optional exec?: ExecOptions;

How to start the child. Identical to run’s options, deliberately: spawn is a different view of one exec rather than a different exec.


optional gapPolicy?: GapPolicy;

What to do when the daemon reports evicted output. Defaults to 'error'; see [crate::process] for why.


optional idleTimeout?: number;

How long the body may be silent before the connection is treated as dead, in seconds.


optional maxReconnects?: number;

How many reconnects before the streams error. A bound rather than forever.


optional offset?: number;

The byte to start reading at. Non-zero resumes output a previous process was reading — which, with a stable exec.execId, is how a spawned process survives this process restarting.

0

optional reconnect?: boolean;

Whether to reconnect after a cut. Defaults to true, and turning it off is what makes a suspend/resume look like a stream that ended.

This page is generated from bindings/microvms-js/index.d.ts by TypeDoc 0.28.20 and typedoc-plugin-markdown 4.13.1, run from site/scripts/gen-reference.mjs on every pnpm run sync, so an edit made here is overwritten by the next run.

To change the page, change the doc comment in the binding’s Rust source, then regenerate the declarations with mise run dts. mise run dts:check fails when the committed file no longer matches the source.