refactor: silence sonar
[poolifier.git] / src / pools / thread / fixed.ts
index 197830279be020e45741fb00930bb82ffcc12ea3..f48d0bcd9960da1a2ff89582035a9ad9a9581774 100644 (file)
@@ -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<Worker>
+
 /**
  * A thread pool with a fixed number of threads.
  *
@@ -32,9 +37,10 @@ export class FixedThreadPool<
   public constructor (
     numberOfThreads: number,
     filePath: string,
-    protected readonly opts: PoolOptions<Worker> = {}
+    opts: ThreadPoolOptions = {},
+    maximumNumberOfThreads?: number
   ) {
-    super(numberOfThreads, filePath, opts)
+    super(numberOfThreads, filePath, opts, maximumNumberOfThreads)
   }
 
   /** @inheritDoc */
@@ -102,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