import { randomUUID } from 'node:crypto'
import { performance } from 'node:perf_hooks'
import type { TransferListItem } from 'node:worker_threads'
-import { type EventEmitter, EventEmitterAsyncResource } from 'node:events'
+import { EventEmitterAsyncResource } from 'node:events'
import type {
MessageValue,
PromiseResponseWrapper,
public readonly workerNodes: Array<IWorkerNode<Worker, Data>> = []
/** @inheritDoc */
- public emitter?: EventEmitter | EventEmitterAsyncResource
+ public emitter?: EventEmitterAsyncResource
/**
* The task execution response promise map:
})
)
this.emitter?.emit(PoolEvents.destroy, this.info)
- if (this.emitter instanceof EventEmitterAsyncResource) {
- this.emitter?.emitDestroy()
- }
+ this.emitter?.emitDestroy()
this.started = false
}