X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FChargingStationWorker.ts;h=cc0f62726a174350095ade3fd4805a0204c753bd;hb=de9136ae2018e1dec8b069184bd7dd5a5968d8d7;hp=20a812e496a78f1f128b88a2f33df652ab04ee74;hpb=07f350040f34e6727c548bc645e9982c189cd4ef;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ChargingStationWorker.ts b/src/charging-station/ChargingStationWorker.ts index 20a812e4..cc0f6272 100644 --- a/src/charging-station/ChargingStationWorker.ts +++ b/src/charging-station/ChargingStationWorker.ts @@ -1,6 +1,6 @@ // Partial Copyright Jerome Benoit. 2021. All Rights Reserved. -import { ChargingStationWorkerData, WorkerEvents, WorkerMessage } from '../types/Worker'; +import { ChargingStationWorkerData, ChargingStationWorkerMessage, ChargingStationWorkerMessageEvents } from '../types/ChargingStationWorker'; import { parentPort, workerData } from 'worker_threads'; import ChargingStation from './ChargingStation'; @@ -24,8 +24,8 @@ if (Utils.workerPoolInUse()) { * Listen messages send by the main thread */ function addMessageListener(): void { - parentPort?.on('message', (message: WorkerMessage) => { - if (message.id === WorkerEvents.START_WORKER_ELEMENT) { + parentPort?.on('message', (message: ChargingStationWorkerMessage) => { + if (message.id === ChargingStationWorkerMessageEvents.START_WORKER_ELEMENT) { startChargingStation(message.data); } });