chore: v2.3.8
[poolifier.git] / src / pools / abstract-pool.ts
index 76f5bfdc24d47820f9cb2aaaac8ca387a4670a55..695c43b30d3f6697a5407a60ff3ceeca05248350 100644 (file)
@@ -2,7 +2,7 @@ import type {
   MessageValue,
   PromiseWorkerResponseWrapper
 } from '../utility-types'
-import { EMPTY_FUNCTION, EMPTY_LITERAL } from '../utils'
+import { EMPTY_FUNCTION, EMPTY_OBJECT_LITERAL } from '../utils'
 import { isKillBehavior, KillBehaviors } from '../worker/worker-options'
 import type { PoolOptions } from './pool'
 import { PoolEmitter } from './pool'
@@ -208,7 +208,7 @@ export abstract class AbstractPool<
     const res = this.internalExecute(worker, this.nextMessageId)
     this.checkAndEmitBusy()
     this.sendToWorker(worker, {
-      data: data ?? (EMPTY_LITERAL as Data),
+      data: data ?? (EMPTY_OBJECT_LITERAL as Data),
       id: this.nextMessageId
     })
     ++this.nextMessageId
@@ -218,7 +218,11 @@ export abstract class AbstractPool<
 
   /** {@inheritDoc} */
   public async destroy (): Promise<void> {
-    await Promise.all(this.workers.map(worker => this.destroyWorker(worker)))
+    await Promise.all(
+      this.workers.map(async worker => {
+        await this.destroyWorker(worker)
+      })
+    )
   }
 
   /**