From 6b81370106fdec4cab2d203f6892a7d79c2cd5c2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 10 Jul 2023 09:59:54 +0200 Subject: [PATCH] docs: improve code comments 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 | 6 ++++++ src/worker/abstract-worker.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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) { -- 2.34.1