From bb801643d43c2ee5ccb37a6123a2e1d60b2e6e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=89=BA=E4=B8=BA?= <15897461476@139.com> Date: Tue, 22 Aug 2023 17:27:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=A8=A1=E6=9D=BF=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李艺为 <15897461476@139.com> --- entry/src/main/ets/workers/MyWorker.ts | 18 -------------- entry/src/main/ets/workers/PngLoadWorker.ts | 26 --------------------- 2 files changed, 44 deletions(-) diff --git a/entry/src/main/ets/workers/MyWorker.ts b/entry/src/main/ets/workers/MyWorker.ts index 9ba3e0f..510eedf 100644 --- a/entry/src/main/ets/workers/MyWorker.ts +++ b/entry/src/main/ets/workers/MyWorker.ts @@ -16,12 +16,6 @@ import worker, { ThreadWorkerGlobalScope, MessageEvents, ErrorEvent } from '@oho var workerPort: ThreadWorkerGlobalScope = worker.workerPort; -/** - * Defines the event handler to be called when the worker thread receives a message sent by the host thread. - * The event handler is executed in the worker thread. - * - * @param e message data - */ workerPort.onmessage = function (e: MessageEvents) { console.log("MyWorker.ts workerPort.onmessage:" + e.data) @@ -29,22 +23,10 @@ workerPort.onmessage = function (e: MessageEvents) { workerPort.postMessage("天天向上") } -/** - * Defines the event handler to be called when the worker receives a message that cannot be deserialized. - * The event handler is executed in the worker thread. - * - * @param e message data - */ workerPort.onmessageerror = function (e: MessageEvents) { console.log("MyWorker.ts workerPort.onmessageerror") } -/** - * Defines the event handler to be called when an exception occurs during worker execution. - * The event handler is executed in the worker thread. - * - * @param e error message - */ workerPort.onerror = function (e: ErrorEvent) { console.log("MyWorker.ts workerPort.onerror") } \ No newline at end of file diff --git a/entry/src/main/ets/workers/PngLoadWorker.ts b/entry/src/main/ets/workers/PngLoadWorker.ts index d9cf419..a4d0178 100644 --- a/entry/src/main/ets/workers/PngLoadWorker.ts +++ b/entry/src/main/ets/workers/PngLoadWorker.ts @@ -17,12 +17,6 @@ import { UPNG } from '@ohos/imageknife/src/main/ets/components/3rd_party/upng/UP var workerPort: ThreadWorkerGlobalScope = worker.workerPort; -/** - * Defines the event handler to be called when the worker thread receives a message sent by the host thread. - * The event handler is executed in the worker thread. - * - * @param e message data - */ workerPort.onmessage = function (e: MessageEvents) { var data = e.data; switch (data.type) { @@ -50,24 +44,4 @@ workerPort.onmessage = function (e: MessageEvents) { default: break } -} - -/** - * Defines the event handler to be called when the worker receives a message that cannot be deserialized. - * The event handler is executed in the worker thread. - * - * @param e message data - */ -workerPort.onmessageerror = function (e: MessageEvents) { - console.log("PngLoadWorker.ts workerPort.onmessageerror: " + e.data) -} - -/** - * Defines the event handler to be called when an exception occurs during worker execution. - * The event handler is executed in the worker thread. - * - * @param e error message - */ -workerPort.onerror = function (e: ErrorEvent) { - console.log("PngLoadWorker.ts workerPort.onerror: " + e.message) } \ No newline at end of file