X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2FWorkerAbstract.ts;h=bfb7933639eb1e3445e6bd71cafeef12807f2b3e;hb=e7454a1f193140bdd635fd3b8b489c51b774f9d1;hp=12cc7c735f257ed624c8de35d5198865361edec7;hpb=4d7227e61934a6b082a4d89268c454f7ee3605e1;p=e-mobility-charging-stations-simulator.git diff --git a/src/worker/WorkerAbstract.ts b/src/worker/WorkerAbstract.ts index 12cc7c73..bfb79336 100644 --- a/src/worker/WorkerAbstract.ts +++ b/src/worker/WorkerAbstract.ts @@ -1,6 +1,6 @@ import { WorkerData, WorkerOptions } from '../types/Worker'; -import Constants from '../utils/Constants'; +import WorkerConstants from './WorkerConstants'; export default abstract class WorkerAbstract { protected readonly workerScript: string; @@ -14,15 +14,20 @@ export default abstract class WorkerAbstract { * @param workerScript * @param workerOptions */ - constructor(workerScript: string, workerOptions: WorkerOptions = { - workerStartDelay: Constants.WORKER_START_DELAY, - elementStartDelay: Constants.ELEMENT_START_DELAY, - poolMinSize: Constants.DEFAULT_WORKER_POOL_MIN_SIZE, - poolMaxSize: Constants.DEFAULT_WORKER_POOL_MAX_SIZE, - elementsPerWorker: Constants.DEFAULT_CHARGING_STATIONS_PER_WORKER, - poolOptions: {}, - messageHandler: () => { /* This is intentional */ } - }) { + constructor( + workerScript: string, + workerOptions: WorkerOptions = { + workerStartDelay: WorkerConstants.DEFAULT_WORKER_START_DELAY, + elementStartDelay: WorkerConstants.DEFAULT_ELEMENT_START_DELAY, + poolMinSize: WorkerConstants.DEFAULT_POOL_MIN_SIZE, + poolMaxSize: WorkerConstants.DEFAULT_POOL_MAX_SIZE, + elementsPerWorker: WorkerConstants.DEFAULT_ELEMENTS_PER_WORKER, + poolOptions: {}, + messageHandler: () => { + /* This is intentional */ + }, + } + ) { this.workerScript = workerScript; this.workerOptions = workerOptions; }