HUGE refactore, once again.
This commit is contained in:
@@ -67,7 +67,7 @@ async function run() {
|
||||
.parse();
|
||||
|
||||
let generatedManifest = await bundle(args._[0], !!args.debug);
|
||||
writeFile(args._[1], JSON.stringify(generatedManifest, null, 2));
|
||||
await writeFile(args._[1], JSON.stringify(generatedManifest, null, 2));
|
||||
}
|
||||
|
||||
run().catch((e) => {
|
||||
|
||||
@@ -20,7 +20,6 @@ export class NodeSandbox implements Sandbox {
|
||||
|
||||
constructor(readonly system: System<any>, workerScript: string) {
|
||||
this.worker = new Worker(workerScript);
|
||||
|
||||
this.worker.on("message", this.onmessage.bind(this));
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,6 @@ test("Run a Node sandbox", async () => {
|
||||
for (let i = 0; i < 100; i++) {
|
||||
expect(await plug.invoke("addNumbersSyscall", [10, i])).toBe(10 + i);
|
||||
}
|
||||
console.log(plug.sandbox);
|
||||
// console.log(plug.sandbox);
|
||||
await system.stop();
|
||||
});
|
||||
|
||||
@@ -31,7 +31,6 @@ export class Plug<HookT> {
|
||||
if (!this.sandbox.isLoaded(name)) {
|
||||
await this.sandbox.load(name, this.manifest!.functions[name].code!);
|
||||
}
|
||||
console.log("Loaded", name);
|
||||
return await this.sandbox.invoke(name, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ControllerMessage, WorkerMessage } from "./types";
|
||||
import { Plug, Sandbox, System } from "./runtime";
|
||||
import { Sandbox, System } from "./runtime";
|
||||
|
||||
export class WebworkerSandbox implements Sandbox {
|
||||
private worker: Worker;
|
||||
|
||||
Reference in New Issue
Block a user