From: aardizio Date: Sun, 19 Jan 2020 14:07:07 +0000 (+0100) Subject: TODO added X-Git-Tag: v0.0.1~43 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=8a306b856cd85a189f6ff9b232852726e2850b4e;p=poolifier.git TODO added --- 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])