X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2FWorkerFactory.ts;h=dba59173510a3e63e33c7dafa191d444eb406385;hb=967511dc5ba15e74610c2b48996b7e7c279b01cb;hp=fcfe4f80677820266f8438aab242907d281de1ff;hpb=ded13d9799aa6fb958da48a6b702d4193e7954f2;p=e-mobility-charging-stations-simulator.git diff --git a/src/worker/WorkerFactory.ts b/src/worker/WorkerFactory.ts index fcfe4f80..dba59173 100644 --- a/src/worker/WorkerFactory.ts +++ b/src/worker/WorkerFactory.ts @@ -8,7 +8,7 @@ import Wrk from './Wrk'; import { isMainThread } from 'worker_threads'; export default class WorkerFactory { - public static getWorkerImpl(workerScript: string, workerProcessType: WorkerProcessType, options?: WorkerOptions): Wrk { + public static getWorkerImplementation(workerScript: string, workerProcessType: WorkerProcessType, options?: WorkerOptions): Wrk { if (!isMainThread) { throw new Error('Trying to get a worker implementation outside the main thread'); } @@ -23,15 +23,15 @@ export default class WorkerFactory { return new WorkerSet(workerScript, options.elementsPerWorker); case WorkerProcessType.STATIC_POOL: if (Utils.isUndefined(options.poolMaxSize)) { - options.elementsPerWorker = 16; + options.poolMaxSize = 16; } return new WorkerStaticPool(workerScript, options.poolMaxSize); case WorkerProcessType.DYNAMIC_POOL: if (Utils.isUndefined(options.poolMinSize)) { - options.elementsPerWorker = 4; + options.poolMinSize = 4; } if (Utils.isUndefined(options.poolMaxSize)) { - options.elementsPerWorker = 16; + options.poolMaxSize = 16; } return new WorkerDynamicPool(workerScript, options.poolMinSize, options.poolMaxSize); default: