X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fthread%2Ffixed.ts;h=f48d0bcd9960da1a2ff89582035a9ad9a9581774;hb=d1c03778bd26af064147055fc21d6701ffefb707;hp=d2f4df8e43f8fe0a905e115510c0c22424891313;hpb=26ce26ca8861318068427cc86697103e7a3ddbf4;p=poolifier.git diff --git a/src/pools/thread/fixed.ts b/src/pools/thread/fixed.ts index d2f4df8e..f48d0bcd 100644 --- a/src/pools/thread/fixed.ts +++ b/src/pools/thread/fixed.ts @@ -10,6 +10,11 @@ import { AbstractPool } from '../abstract-pool' import { type PoolOptions, type PoolType, PoolTypes } from '../pool' import { type WorkerType, WorkerTypes } from '../worker' +/** + * Options for a poolifier thread pool. + */ +export type ThreadPoolOptions = PoolOptions + /** * A thread pool with a fixed number of threads. * @@ -32,7 +37,7 @@ export class FixedThreadPool< public constructor ( numberOfThreads: number, filePath: string, - opts: PoolOptions = {}, + opts: ThreadPoolOptions = {}, maximumNumberOfThreads?: number ) { super(numberOfThreads, filePath, opts, maximumNumberOfThreads) @@ -103,6 +108,16 @@ export class FixedThreadPool< ) } + /** @inheritDoc */ + protected shallCreateDynamicWorker (): boolean { + return false + } + + /** @inheritDoc */ + protected checkAndEmitDynamicWorkerCreationEvents (): void { + /* noop */ + } + /** @inheritDoc */ protected get type (): PoolType { return PoolTypes.fixed