## [Unreleased]
+### Fixed
+
+- Fix pool event emitter registered callbacks removal at `destroy()`.
+
## [3.1.21] - 2024-02-22
### Fixed
Default: `true`
- `restartWorkerOnError` (optional) - Restart worker on uncaught error in this pool.
Default: `true`
-- `enableEvents` (optional) - Events integrated with async resource emission enablement in this pool.
+- `enableEvents` (optional) - Pool events integrated with async resource emission enablement.
Default: `true`
- `enableTasksQueue` (optional) - Tasks queue per worker enablement in this pool.
Default: `false`
)
this.emitter?.emit(PoolEvents.destroy, this.info)
this.emitter?.emitDestroy()
- this.emitter?.removeAllListeners()
this.readyEventEmitted = false
this.destroying = false
this.started = false
*/
readonly workerNodes: Array<IWorkerNode<Worker, Data>>
/**
- * Event emitter integrated with async resource on which events can be listened to.
+ * Pool event emitter integrated with async resource.
* The async tracking tooling identifier is `poolifier:<PoolType>-<WorkerType>-pool`.
*
* Events that can currently be listened to:
await pool.destroy()
const numberOfExitEvents = await exitPromise
expect(pool.started).toBe(false)
- expect(pool.emitter.eventNames()).toStrictEqual([])
+ expect(pool.emitter.eventNames()).toStrictEqual(['busy', 'destroy'])
expect(pool.readyEventEmitted).toBe(false)
expect(pool.workerNodes.length).toBe(0)
expect(numberOfExitEvents).toBe(min)
await pool.destroy()
const numberOfExitEvents = await exitPromise
expect(pool.started).toBe(false)
- expect(pool.emitter.eventNames()).toStrictEqual([])
+ expect(pool.emitter.eventNames()).toStrictEqual(['busy', 'destroy'])
expect(pool.readyEventEmitted).toBe(false)
expect(pool.workerNodes.length).toBe(0)
expect(numberOfExitEvents).toBe(numberOfWorkers)
await pool.destroy()
const numberOfExitEvents = await exitPromise
expect(pool.started).toBe(false)
- expect(pool.emitter.eventNames()).toStrictEqual([])
+ expect(pool.emitter.eventNames()).toStrictEqual(['busy', 'destroy'])
expect(pool.readyEventEmitted).toBe(false)
expect(pool.workerNodes.length).toBe(0)
expect(numberOfExitEvents).toBe(min)
await pool.destroy()
const numberOfExitEvents = await exitPromise
expect(pool.started).toBe(false)
- expect(pool.emitter.eventNames()).toStrictEqual([])
+ expect(pool.emitter.eventNames()).toStrictEqual(['busy', 'destroy'])
expect(pool.readyEventEmitted).toBe(false)
expect(pool.workerNodes.length).toBe(0)
expect(numberOfExitEvents).toBe(numberOfThreads)