From 56e2e1ab1829773ae32048930fbf6c4c98333891 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 9 Jul 2023 02:41:48 +0200 Subject: [PATCH] fix: flag dynamic pool mode as experimental MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- README.md | 2 +- src/charging-station/Bootstrap.ts | 6 ++++++ src/worker/WorkerTypes.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dbf0533e..58b18004 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ But the modifications to test have to be done to the files in the build target d - **staticPool**: Statically sized worker pool executing a static total number of simulated charging stations -- **dynamicPool**: +- **dynamicPool** (experimental): Dynamically sized worker pool executing a static total number of simulated charging stations ### Charging station configuration template diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index e329a65b..1b4934ed 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -142,6 +142,12 @@ export class Bootstrap extends EventEmitter { }` ) ); + Configuration.workerDynamicPoolInUse() && + console.warn( + chalk.yellow( + 'Charging stations simulator is using dynamic pool mode. This is an experimental feature with known issues.\nPlease consider using static pool or worker set mode instead' + ) + ); console.info(chalk.green('Worker set/pool information:'), this.workerImplementation?.info); this.started = true; this.starting = false; diff --git a/src/worker/WorkerTypes.ts b/src/worker/WorkerTypes.ts index 3986164b..5bf339fb 100644 --- a/src/worker/WorkerTypes.ts +++ b/src/worker/WorkerTypes.ts @@ -4,6 +4,7 @@ import { type PoolEvent, PoolEvents, type ThreadPoolOptions } from 'poolifier'; export enum WorkerProcessType { workerSet = 'workerSet', + /** @experimental */ dynamicPool = 'dynamicPool', staticPool = 'staticPool', } -- 2.34.1