mirror of
https://github.com/denoland/deno.git
synced 2025-01-09 07:39:15 -05:00
make Worker.poll private (#4603)
This commit is contained in:
parent
ce02167c75
commit
e99374a0a3
1 changed files with 3 additions and 3 deletions
|
@ -92,7 +92,7 @@ export class WorkerImpl extends EventTarget implements Worker {
|
|||
options?.name
|
||||
);
|
||||
this.#id = id;
|
||||
this.poll();
|
||||
this.#poll();
|
||||
}
|
||||
|
||||
#handleError = (e: any): boolean => {
|
||||
|
@ -116,7 +116,7 @@ export class WorkerImpl extends EventTarget implements Worker {
|
|||
return handled;
|
||||
};
|
||||
|
||||
async poll(): Promise<void> {
|
||||
#poll = async (): Promise<void> => {
|
||||
while (!this.#terminated) {
|
||||
const event = await hostGetMessage(this.#id);
|
||||
|
||||
|
@ -150,7 +150,7 @@ export class WorkerImpl extends EventTarget implements Worker {
|
|||
|
||||
throw new Error(`Unknown worker event: "${type}"`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
postMessage(data: any): void {
|
||||
if (this.#terminated) {
|
||||
|
|
Loading…
Reference in a new issue