Align worker code naming.
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 19 Feb 2021 20:32:54 +0000 (21:32 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 19 Feb 2021 20:32:54 +0000 (21:32 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/worker/WorkerDynamicPool.ts
src/worker/WorkerStaticPool.ts

index 0cbefdf66ed455b8ccc924384129b7a184361c18..d30f9b7a9bb4d2725c8f904099ee5db2af949fb9 100644 (file)
@@ -59,13 +59,13 @@ export default class WorkerDynamicPool<T> extends Wrk {
 class DynamicPool extends DynamicThreadPool<WorkerData> {
   private static instance: DynamicPool;
 
-  private constructor(min: number, max: number, filename: string, opts?: PoolOptions<Worker>) {
-    super(min, max, filename, opts);
+  private constructor(min: number, max: number, workerScript: string, opts?: PoolOptions<Worker>) {
+    super(min, max, workerScript, opts);
   }
 
-  public static getInstance(min: number, max: number, filename: string): DynamicPool {
+  public static getInstance(min: number, max: number, workerScript: string): DynamicPool {
     if (!DynamicPool.instance) {
-      DynamicPool.instance = new DynamicPool(min, max, filename,
+      DynamicPool.instance = new DynamicPool(min, max, workerScript,
         {
           exitHandler: (code) => {
             if (code !== 0) {
index 3a144c35ac7fa5464db448967a83beafaa0c462e..ca8c02a0fa613dc1050a18559bd87f82989d16db 100644 (file)
@@ -14,9 +14,9 @@ export default class WorkerStaticPool<T> extends Wrk {
    *
    * @param {string} workerScript
    */
-  constructor(workerScript: string, numThreads: number) {
+  constructor(workerScript: string, numberOfThreads: number) {
     super(workerScript);
-    this.pool = StaticPool.getInstance(numThreads, this.workerScript);
+    this.pool = StaticPool.getInstance(numberOfThreads, this.workerScript);
   }
 
   get size(): number {
@@ -59,13 +59,13 @@ export default class WorkerStaticPool<T> extends Wrk {
 class StaticPool extends FixedThreadPool<WorkerData> {
   private static instance: StaticPool;
 
-  private constructor(numThreads: number, workerScript: string, opts?: PoolOptions<Worker>) {
-    super(numThreads, workerScript, opts);
+  private constructor(numberOfThreads: number, workerScript: string, opts?: PoolOptions<Worker>) {
+    super(numberOfThreads, workerScript, opts);
   }
 
-  public static getInstance(numThreads: number, workerScript: string): StaticPool {
+  public static getInstance(numberOfThreads: number, workerScript: string): StaticPool {
     if (!StaticPool.instance) {
-      StaticPool.instance = new StaticPool(numThreads, workerScript,
+      StaticPool.instance = new StaticPool(numberOfThreads, workerScript,
         {
           exitHandler: (code) => {
             if (code !== 0) {