From 8a306b856cd85a189f6ff9b232852726e2850b4e Mon Sep 17 00:00:00 2001 From: aardizio Date: Sun, 19 Jan 2020 15:07:07 +0100 Subject: [PATCH] TODO added --- lib/fixed.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/fixed.js b/lib/fixed.js index 5d5d40e1..95fe6862 100644 --- a/lib/fixed.js +++ b/lib/fixed.js @@ -83,8 +83,10 @@ class FixedThreadPool { _newWorker () { const worker = new Worker(path.resolve(this.filename), { env: SHARE_ENV }) worker.on('error', this.opts.errorHandler || empty) - worker.on('exit', this.opts.exitHandler || empty) worker.on('online', this.opts.onlineHandler || empty) + // TODO remove the workers array , use only the map data structure + // handle properly when a thread exit + worker.on('exit', this.opts.exitHandler || empty) this.workers.push(worker) const { port1, port2 } = new MessageChannel() worker.postMessage({ parent: port1 }, [port1]) -- 2.34.1