"distributeStationsToTenantsEqually": true,
"statisticsDisplayInterval": 60,
"useWorkerPool": false,
- "workerPoolSize": 16,
+ "workerMaxPoolSize": 16,
+ "chargingStationsPerWorker": 1,
"stationTemplateURLs": [
{
"file": "./src/assets/station-templates/siemens.station-template.json",
"distributeStationsToTenantsEqually": true,
"statisticsDisplayInterval": 60,
"useWorkerPool": false,
- "workerPoolSize": 16,
+ "workerMaxPoolSize": 16,
"chargingStationsPerWorker": 1,
"stationTemplateURLs": [
{
this._workerData = workerData;
this._workerScript = workerScript;
if (Configuration.useWorkerPool()) {
- WorkerPool.maxConcurrentWorkers = Configuration.getWorkerPoolSize();
+ WorkerPool.maxConcurrentWorkers = Configuration.getWorkerMaxPoolSize();
}
}
this._worker = worker;
});
}
+
+ /**
+ *
+ * @return {number}
+ * @public
+ */
+ public getPoolSize(): number {
+ return WorkerPool.getPoolSize();
+ }
}
+
class WorkerPool {
public static maxConcurrentWorkers: number;
private static _instance: Pool;
public static acquire(filename: string, options: WorkerOptions, callback: (error: Error | null, worker: Worker) => void): void {
WorkerPool.getInstance().acquire(filename, options, callback);
}
+
+ public static getPoolSize(): number {
+ return WorkerPool._instance.size;
+ }
}
autoReconnectMaxRetries?: number;
distributeStationsToTenantsEqually?: boolean;
useWorkerPool?: boolean;
- workerPoolSize?: number;
+ workerMaxPoolSize?: number;
chargingStationsPerWorker?: number;
logFormat?: string;
logLevel?: string;
return Configuration.getConfig().useWorkerPool;
}
- static getWorkerPoolSize(): number {
- return Configuration.getConfig().workerPoolSize;
+ static getWorkerMaxPoolSize(): number {
+ return Configuration.getConfig().workerMaxPoolSize;
}
static getChargingStationsPerWorker(): number {