diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-08-01 12:36:17 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-08-02 12:49:40 -0400 |
commit | 421358e7a9612527fdd9ed9a9a59635c12cdaab5 (patch) | |
tree | 0f4d4ca9526745512c7a95a5ea27030a5080e98c /js/main.ts | |
parent | df8208557d684938e5e50aadbd41b9bcbc37d072 (diff) |
Remove dispatch.ts and move assignCmdId to util.ts
Diffstat (limited to 'js/main.ts')
-rw-r--r-- | js/main.ts | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/js/main.ts b/js/main.ts index f5fa0b6ac..50f73a4c6 100644 --- a/js/main.ts +++ b/js/main.ts @@ -3,17 +3,9 @@ /// <reference path="deno.d.ts" /> import { flatbuffers } from "flatbuffers"; import { deno as fbs } from "gen/msg_generated"; -import { assert, log } from "./util"; +import { assert, log, assignCmdId } from "./util"; import * as runtime from "./runtime"; -let cmdIdCounter = 0; -function assignCmdId(): number { - // TODO(piscisaureus) Safely re-use so they don't overflow. - const cmdId = ++cmdIdCounter; - assert(cmdId < 2 ** 32, "cmdId overflow"); - return cmdId; -} - function startMsg(cmdId: number): Uint8Array { const builder = new flatbuffers.Builder(); fbs.Start.startStart(builder); |