From: Jérôme Benoit Date: Fri, 19 Feb 2021 20:32:54 +0000 (+0100) Subject: Align worker code naming. X-Git-Tag: v1.0.1-0~103^2~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=63b19acd0a16da3d348fd5aff8d4172e12fba954;p=e-mobility-charging-stations-simulator.git Align worker code naming. Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/WorkerDynamicPool.ts b/src/worker/WorkerDynamicPool.ts index 0cbefdf6..d30f9b7a 100644 --- a/src/worker/WorkerDynamicPool.ts +++ b/src/worker/WorkerDynamicPool.ts @@ -59,13 +59,13 @@ export default class WorkerDynamicPool extends Wrk { class DynamicPool extends DynamicThreadPool { private static instance: DynamicPool; - private constructor(min: number, max: number, filename: string, opts?: PoolOptions) { - super(min, max, filename, opts); + private constructor(min: number, max: number, workerScript: string, opts?: PoolOptions) { + 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) { diff --git a/src/worker/WorkerStaticPool.ts b/src/worker/WorkerStaticPool.ts index 3a144c35..ca8c02a0 100644 --- a/src/worker/WorkerStaticPool.ts +++ b/src/worker/WorkerStaticPool.ts @@ -14,9 +14,9 @@ export default class WorkerStaticPool 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 extends Wrk { class StaticPool extends FixedThreadPool { private static instance: StaticPool; - private constructor(numThreads: number, workerScript: string, opts?: PoolOptions) { - super(numThreads, workerScript, opts); + private constructor(numberOfThreads: number, workerScript: string, opts?: PoolOptions) { + 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) {