mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 13:44:08 +00:00
Clean up how we use opIds (#4118)
This commit is contained in:
parent
805992b14a
commit
91b606aaae
74 changed files with 367 additions and 589 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue