X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fthread%2Ffixed.ts;h=69b3c3071e487abf1658c454289c7117ee351152;hb=7169bda30538a5244b2598a4ef466c5687953ebd;hp=7977cd61abd5263023b855fe9f7f23ba5135de10;hpb=5d9133ae9ef83c5f69e26daf8dcfea584884d9c4;p=poolifier.git diff --git a/src/pools/thread/fixed.ts b/src/pools/thread/fixed.ts index 7977cd61..69b3c307 100644 --- a/src/pools/thread/fixed.ts +++ b/src/pools/thread/fixed.ts @@ -1,7 +1,7 @@ import { isMainThread, type TransferListItem, - type Worker + type Worker, } from 'node:worker_threads' import type { MessageValue } from '../../utility-types.js' @@ -16,7 +16,6 @@ export type ThreadPoolOptions = PoolOptions /** * A thread pool with a fixed number of threads. - * * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data. * @typeParam Response - Type of execution response. This can only be structured-cloneable data. * @author [Alessandro Pio Ardizio](https://github.com/pioardi) @@ -28,10 +27,10 @@ export class FixedThreadPool< > extends AbstractPool { /** * Constructs a new poolifier fixed thread pool. - * * @param numberOfThreads - Number of threads for this pool. * @param filePath - Path to an implementation of a `ThreadWorker` file, which can be relative or absolute. * @param opts - Options for this fixed thread pool. + * @param maximumNumberOfThreads - The maximum number of threads for this pool. */ public constructor ( numberOfThreads: number, @@ -56,7 +55,7 @@ export class FixedThreadPool< this.workerNodes[workerNodeKey]?.messageChannel?.port1.postMessage( { ...message, - workerId: this.getWorkerInfo(workerNodeKey)?.id + workerId: this.getWorkerInfo(workerNodeKey)?.id, } satisfies MessageValue, transferList ) @@ -71,7 +70,7 @@ export class FixedThreadPool< { ready: false, workerId: this.getWorkerInfo(workerNodeKey)?.id, - port: port2 + port: port2, } satisfies MessageValue, [port2] )