Skip to content
1 min read · 100 words

Interface: GuestRuntime

Defined in: src/batteries/sandbox/contracts/guest_runtime.ts:6

Runtime boundary for a hardened guest realm; limits and capability declarations cross the boundary.

Methods

spawn()

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

Defined in: src/batteries/sandbox/contracts/guest_runtime.ts:8

Spawn a guest with fully resolved hostile-realm limits and async capability stubs.

Parameters

ParameterType
o{ globals: readonly { kind: "async-fn"; name: string; }[]; limits: GuestLimits; modules: string[]; signal?: AbortSignal; }
o.globalsreadonly { kind: "async-fn"; name: string; }[]
o.limitsGuestLimits
o.modulesstring[]
o.signal?AbortSignal

Returns

Promise<GuestHandle>