-import { WorkerData, WorkerEvents } from '../types/Worker';
+import { StationWorkerData, WorkerEvents } from '../types/Worker';
import { isMainThread, parentPort, workerData } from 'worker_threads';
import ChargingStation from './ChargingStation';
});
}
-function startChargingStation(data: WorkerData) {
+function startChargingStation(data: StationWorkerData) {
const station = new ChargingStation(data.index , data.templateFile);
station.start();
}
import Configuration from './utils/Configuration';
+import { StationWorkerData } from './types/Worker';
import Utils from './utils/Utils';
-import { WorkerData } from './types/Worker';
import WorkerFactory from './worker/WorkerFactory';
import Wrk from './worker/Wrk';
try {
const nbStations = stationURL.numberOfStations ? stationURL.numberOfStations : 0;
for (let index = 1; index <= nbStations; index++) {
- const workerData: WorkerData = {
+ const workerData: StationWorkerData = {
index,
templateFile: stationURL.file
};
STATIC_POOL = 'staticPool'
}
-// FIXME: make it more generic
-export interface WorkerData {
+export interface WorkerData { }
+
+export interface StationWorkerData extends WorkerData {
index: number;
templateFile: string;
}