Clean up how we use opIds (#4118)

This commit is contained in:
Ryan Dahl 2020-02-25 09:14:27 -05:00 committed by GitHub
parent 805992b14a
commit 91b606aaae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 367 additions and 589 deletions

View file

@ -16,7 +16,6 @@ import {
windowOrWorkerGlobalScopeProperties,
eventTargetProperties
} from "./globals.ts";
import * as dispatch from "./dispatch.ts";
import { sendSync } from "./dispatch_json.ts";
import { log } from "./util.ts";
import { TextEncoder } from "./text_encoding.ts";
@ -32,7 +31,7 @@ export const onerror: (e: { data: any }) => void = (): void => {};
export function postMessage(data: any): void {
const dataJson = JSON.stringify(data);
const dataIntArray = encoder.encode(dataJson);
sendSync(dispatch.OP_WORKER_POST_MESSAGE, {}, dataIntArray);
sendSync("op_worker_post_message", {}, dataIntArray);
}
let isClosing = false;
@ -44,7 +43,7 @@ export function close(): void {
}
isClosing = true;
sendSync(dispatch.OP_WORKER_CLOSE);
sendSync("op_worker_close");
}
export async function workerMessageRecvCallback(data: string): Promise<void> {