From: Jérôme Benoit Date: Sun, 9 Apr 2023 12:44:57 +0000 (+0200) Subject: docs: refine tasks response handling documentation X-Git-Tag: v2.4.5~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a34454964733f585af19a04f21f9e35eb18c77b1;p=poolifier.git docs: refine tasks response handling documentation Signed-off-by: Jérôme Benoit --- 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 }