From 60664f486ce7ff5a437b52c545cf219eca5aebd2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 8 Jul 2023 00:53:53 +0200 Subject: [PATCH] docs: add comments to worker node class MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/worker-node.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/pools/worker-node.ts b/src/pools/worker-node.ts index eb2085bc..c2acd65b 100644 --- a/src/pools/worker-node.ts +++ b/src/pools/worker-node.ts @@ -10,6 +10,12 @@ import { type WorkerUsage } from './worker' +/** + * Worker node. + * + * @typeParam Worker - Type of worker. + * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data. + */ export class WorkerNode implements IWorkerNode { public readonly worker: Worker @@ -17,6 +23,13 @@ implements IWorkerNode { public usage: WorkerUsage private readonly tasksQueue: Queue> + /** + * Constructs a new worker node. + * + * @param worker - The worker. + * @param workerType - The worker type. + * @internal + */ constructor (worker: Worker, workerType: WorkerType) { this.worker = worker this.info = this.initWorkerInfo(worker, workerType) @@ -106,6 +119,7 @@ implements IWorkerNode { * Gets the worker id. * * @param worker - The worker. + * @param workerType - The worker type. * @returns The worker id. */ private getWorkerId ( -- 2.34.1