From: Jérôme Benoit Date: Sun, 9 Jul 2023 00:41:48 +0000 (+0200) Subject: fix: flag dynamic pool mode as experimental X-Git-Tag: v1.2.18~60 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=56e2e1ab1829773ae32048930fbf6c4c98333891;p=e-mobility-charging-stations-simulator.git fix: flag dynamic pool mode as experimental Signed-off-by: Jérôme Benoit --- 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', }