repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: cleanup worker code
[poolifier.git]
/
src
/
pools
/
thread
/
fixed.ts
diff --git
a/src/pools/thread/fixed.ts
b/src/pools/thread/fixed.ts
index bf111d39482528c4078f13e5c76557d565895f7f..73740baa92110e213b427fe0ca1f8aeafebe307c 100644
(file)
--- a/
src/pools/thread/fixed.ts
+++ b/
src/pools/thread/fixed.ts
@@
-70,6
+70,7
@@
export class FixedThreadPool<
})
await this.sendKillMessageToWorker(workerNodeKey)
workerNode.closeChannel()
})
await this.sendKillMessageToWorker(workerNodeKey)
workerNode.closeChannel()
+ workerNode.removeAllListeners()
await worker.terminate()
await waitWorkerExit
}
await worker.terminate()
await waitWorkerExit
}
@@
-82,7
+83,7
@@
export class FixedThreadPool<
): void {
(
this.workerNodes[workerNodeKey]?.messageChannel as MessageChannel
): void {
(
this.workerNodes[workerNodeKey]?.messageChannel as MessageChannel
- )
.port1
.postMessage(
+ )
?.port1?
.postMessage(
{ ...message, workerId: this.getWorkerInfo(workerNodeKey).id },
transferList
)
{ ...message, workerId: this.getWorkerInfo(workerNodeKey).id },
transferList
)