Lazy initialize sandboxes (workers) upon first need

This commit is contained in:
Zef Hemel
2022-11-01 09:57:20 +01:00
parent a5b8fce3eb
commit 5d9329a531
6 changed files with 40 additions and 18 deletions
+2 -1
View File
@@ -1,6 +1,6 @@
import { Hook, Manifest, RuntimeEnvironment } from "./types.ts";
import { EventEmitter } from "./event.ts";
import { SandboxFactory } from "./sandbox.ts";
import { Sandbox, SandboxFactory } from "./sandbox.ts";
import { Plug } from "./plug.ts";
export interface SysCallMapping {
@@ -11,6 +11,7 @@ export type SystemJSON<HookT> = Manifest<HookT>[];
export type SystemEvents<HookT> = {
plugLoaded: (plug: Plug<HookT>) => void | Promise<void>;
sandboxInitialized(sandbox: Sandbox, plug: Plug<HookT>): void | Promise<void>;
plugUnloaded: (name: string) => void | Promise<void>;
};