summaryrefslogtreecommitdiff
path: root/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'main.ts')
-rw-r--r--main.ts17
1 files changed, 15 insertions, 2 deletions
diff --git a/main.ts b/main.ts
index 44519489a..153414a19 100644
--- a/main.ts
+++ b/main.ts
@@ -1,9 +1,22 @@
//import * as ts from "typescript";
import { main as pb } from "./msg.pb"
+import "./util";
+
+
+function load(argv: string[]): void {
+ console.log("Load argv", argv);
+}
V8Worker2.recv((ab: ArrayBuffer) => {
- let msg = pb.Msg.decode(new Uint8Array(ab));
- V8Worker2.print("msg.argv", msg.argv);
+ const msg = pb.Msg.decode(new Uint8Array(ab));
+ switch (msg.kind) {
+ case pb.Msg.MsgKind.LOAD:
+ load(msg.argv);
+ break;
+ default:
+ console.log("Unknown message", msg);
+ break;
+ }
});
V8Worker2.print("Hello");