build(deps): apply updates
[e-mobility-charging-stations-simulator.git] / src / worker / WorkerStaticPool.ts
index 3786992a7743356f6ed302bf94ed835565062094..af611b6387777843d9d9fc3ef98d3dfdfd047360 100644 (file)
@@ -1,3 +1,4 @@
+import type EventEmitterAsyncResource from 'node:events';
 import type { Worker } from 'node:worker_threads';
 
 import { type ErrorHandler, type ExitHandler, FixedThreadPool } from 'poolifier';
@@ -39,30 +40,21 @@ export class WorkerStaticPool extends WorkerAbstract<WorkerData> {
     return undefined;
   }
 
-  /**
-   *
-   * @returns
-   * @public
-   */
+  get emitter(): EventEmitterAsyncResource | undefined {
+    return this.pool?.emitter;
+  }
+
+  /** @inheritDoc */
   public async start(): Promise<void> {
     // This is intentional
   }
 
-  /**
-   *
-   * @returns
-   * @public
-   */
+  /** @inheritDoc */
   public async stop(): Promise<void> {
     return this.pool.destroy();
   }
 
-  /**
-   *
-   * @param elementData -
-   * @returns
-   * @public
-   */
+  /** @inheritDoc */
   public async addElement(elementData: WorkerData): Promise<void> {
     await this.pool.execute(elementData);
     // Start element sequentially to optimize memory at startup