From: Jérôme Benoit Date: Mon, 10 Jul 2023 07:59:54 +0000 (+0200) Subject: docs: improve code comments X-Git-Tag: v2.6.15~20 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6b81370106fdec4cab2d203f6892a7d79c2cd5c2;p=poolifier.git docs: improve code comments Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 812a2087..8beede87 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -474,6 +474,12 @@ export abstract class AbstractPool< ?.worker } + /** + * Checks if the worker id sent in the received message from a worker is valid. + * + * @param message - The received message. + * @throws {@link https://nodejs.org/api/errors.html#class-error} If the worker id is invalid. + */ private checkMessageWorkerId (message: MessageValue): void { if ( message.workerId != null && diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 5598378a..bfdff391 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -271,7 +271,7 @@ export abstract class AbstractWorker< /** * Worker message listener. * - * @param message - Message received. + * @param message - The received message. */ protected messageListener (message: MessageValue): void { if (message.workerId === this.id) {