Commit | Line | Data |
---|---|---|
1 | import Configuration from '../utils/Configuration'; | |
2 | import WorkerPool from './WorkerPool'; | |
3 | import WorkerSet from './WorkerSet'; | |
4 | import Wrk from './Wrk'; | |
5 | ||
6 | export default class WorkerFactory { | |
7 | public static getWorkerImpl(workerScript: string): Wrk { | |
8 | if (Configuration.useWorkerPool()) { | |
9 | return new WorkerPool(workerScript); | |
10 | } | |
11 | return new WorkerSet(workerScript, Configuration.getChargingStationsPerWorker()); | |
12 | } | |
13 | } |