X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2FWorkerStaticPool.ts;h=af611b6387777843d9d9fc3ef98d3dfdfd047360;hb=15ad763ee257fb7d6b767a6014c273f757641b02;hp=3786992a7743356f6ed302bf94ed835565062094;hpb=789871d6585093e2ab0444bd7ca063ca86c344f8;p=e-mobility-charging-stations-simulator.git diff --git a/src/worker/WorkerStaticPool.ts b/src/worker/WorkerStaticPool.ts index 3786992a..af611b63 100644 --- a/src/worker/WorkerStaticPool.ts +++ b/src/worker/WorkerStaticPool.ts @@ -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 { return undefined; } - /** - * - * @returns - * @public - */ + get emitter(): EventEmitterAsyncResource | undefined { + return this.pool?.emitter; + } + + /** @inheritDoc */ public async start(): Promise { // This is intentional } - /** - * - * @returns - * @public - */ + /** @inheritDoc */ public async stop(): Promise { return this.pool.destroy(); } - /** - * - * @param elementData - - * @returns - * @public - */ + /** @inheritDoc */ public async addElement(elementData: WorkerData): Promise { await this.pool.execute(elementData); // Start element sequentially to optimize memory at startup