mirror of
https://github.com/denoland/deno.git
synced 2025-08-02 10:02:23 +00:00
First pass at fetch()
With help from Thomas Ghysels <info@thomasg.be>
This commit is contained in:
parent
7b0618c20b
commit
868e8d8866
12 changed files with 659 additions and 40 deletions
|
@ -7,6 +7,7 @@ import * as os from "./os";
|
|||
import * as runtime from "./runtime";
|
||||
import { libdeno } from "./globals";
|
||||
import * as timers from "./timers";
|
||||
import { onFetchRes } from "./fetch";
|
||||
|
||||
function startMsg(cmdId: number): Uint8Array {
|
||||
const builder = new flatbuffers.Builder();
|
||||
|
@ -24,6 +25,12 @@ function onMessage(ui8: Uint8Array) {
|
|||
const bb = new flatbuffers.ByteBuffer(ui8);
|
||||
const base = fbs.Base.getRootAsBase(bb);
|
||||
switch (base.msgType()) {
|
||||
case fbs.Any.FetchRes: {
|
||||
const msg = new fbs.FetchRes();
|
||||
assert(base.msg(msg) != null);
|
||||
onFetchRes(base, msg);
|
||||
break;
|
||||
}
|
||||
case fbs.Any.TimerReady: {
|
||||
const msg = new fbs.TimerReady();
|
||||
assert(base.msg(msg) != null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue