Skip to content
1 min read · 148 words

Interface: GuestRuntimeLike

Defined in: src/batteries/sandbox/js/ses_contracts.ts:81

Minimal runtime seam used by the tool and by browser/Node adapters.

Methods

spawn()

ts
spawn(o: {
  globals: readonly {
     kind: "async-fn";
     name: string;
  }[];
  limits: GuestLimits;
  modules: string[];
  signal?: AbortSignal;
}): Promise<{
  evaluate: Promise<GuestOutcome>;
  kill: Promise<void>;
}>;

Defined in: src/batteries/sandbox/js/ses_contracts.ts:89

Start an isolated guest with the declared modules, globals, limits, and lifecycle signal.

Parameters

ParameterTypeDescription
o{ globals: readonly { kind: "async-fn"; name: string; }[]; limits: GuestLimits; modules: string[]; signal?: AbortSignal; }Fully resolved runtime inputs and the names/shapes of injected capabilities; functions themselves do not cross the boundary.
o.globalsreadonly { kind: "async-fn"; name: string; }[]-
o.limitsGuestLimits-
o.modulesstring[]-
o.signal?AbortSignal-

Returns

Promise<{ evaluate: Promise<GuestOutcome>; kill: Promise<void>; }>

A guest handle whose evaluation can be timed out and whose process can be killed.