From a34454964733f585af19a04f21f9e35eb18c77b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 9 Apr 2023 14:44:57 +0200 Subject: [PATCH 1/1] docs: refine tasks response handling documentation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 8 ++++---- src/utility-types.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 34aa634e..f4f3e833 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -33,12 +33,12 @@ export abstract class AbstractPool< public readonly emitter?: PoolEmitter /** - * The promise response map. + * The execution response promise map. * * - `key`: The message id of each submitted task. - * - `value`: An object that contains the worker, the promise resolve and reject callbacks. + * - `value`: An object that contains the worker, the execution response promise resolve and reject callbacks. * - * When we receive a message from the worker we get a map entry with the promise resolve/reject bound to the message. + * When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id. */ protected promiseResponseMap: Map< string, @@ -431,7 +431,7 @@ export abstract class AbstractPool< protected workerListener (): (message: MessageValue) => void { return message => { if (message.id != null) { - // Task response received + // Task execution response received const promiseResponse = this.promiseResponseMap.get(message.id) if (promiseResponse != null) { if (message.error != null) { diff --git a/src/utility-types.ts b/src/utility-types.ts index 458b31a0..b5611f9e 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -62,7 +62,7 @@ export interface PromiseResponseWrapper< */ readonly reject: (reason?: string) => void /** - * The worker handling the promise. + * The worker handling the execution. */ readonly worker: Worker } -- 2.34.1