repositories
/
e-mobility-charging-stations-simulator.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Make the station worker self contained.
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
StationWorker.js
1
const
{
isMainThread
,
workerData
} =
require
(
'worker_threads'
);
2
const
ChargingStation
=
require
(
'./ChargingStation'
);
3
4
if
(!
isMainThread
) {
5
const
station
=
new
ChargingStation
(
workerData
.
index
,
workerData
.
templateFile
);
6
station
.
start
();
7
}