diff options
author | Yingchen Xue <yingchenxue@qq.com> | 2018-06-05 16:10:27 +0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-06-05 10:10:27 +0200 |
commit | 78124cd45f5b5efe1f06e82554ff09273b75b050 (patch) | |
tree | 646f8d233b5827d4b790d4f97ddce977eb1870c5 /fetch.ts | |
parent | 8094c7421b50d3cbbc0eace6d376d7ed31b3cfa1 (diff) |
Rename sendMsg to pubInternal (#136)
Diffstat (limited to 'fetch.ts')
-rw-r--r-- | fetch.ts | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2,11 +2,11 @@ // All rights reserved. MIT License. import { assert, log, createResolvable, Resolvable } from "./util"; import * as util from "./util"; -import * as dispatch from "./dispatch"; +import { pubInternal, sub } from "./dispatch"; import { main as pb } from "./msg.pb"; export function initFetch() { - dispatch.sub("fetch", (payload: Uint8Array) => { + sub("fetch", (payload: Uint8Array) => { const msg = pb.Msg.decode(payload); assert(msg.command === pb.Msg.Command.FETCH_RES); const id = msg.fetchResId; @@ -111,7 +111,7 @@ class FetchRequest { start() { log("dispatch FETCH_REQ", this.id, this.url); - const res = dispatch.sendMsg("fetch", { + const res = pubInternal("fetch", { command: pb.Msg.Command.FETCH_REQ, fetchReqId: this.id, fetchReqUrl: this.url |