+import type EventEmitterAsyncResource from 'node:events';
import type { Worker } from 'node:worker_threads';
import { type ErrorHandler, type ExitHandler, FixedThreadPool } from 'poolifier';
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