Added prettier standard to support prettier and use it in combination with standard
[poolifier.git] / lib / dynamic.js
index 77e5e5facd04804f1581d77c2a2e8c568be99b86..41e3ebaf7cbe1f366b93d24c6c3df21df9ac7f53 100644 (file)
@@ -12,10 +12,10 @@ class MyEmitter extends EventEmitter {}
  */
 class DynamicThreadPool extends FixedThreadPool {
   /**
-    *
-    * @param {Number} min  Min number of threads that will be always active
-    * @param {Number} max  Max number of threads that will be active
-  */
+   *
+   * @param {Number} min  Min number of threads that will be always active
+   * @param {Number} max  Max number of threads that will be active
+   */
   constructor (min, max, filename, opts) {
     super(min, filename, opts)
     this.max = max
@@ -41,13 +41,13 @@ class DynamicThreadPool extends FixedThreadPool {
       }
       // all workers are busy create a new worker
       const worker = this._newWorker()
-      worker.port2.on('message', (message) => {
+      worker.port2.on('message', message => {
         if (message.kill) {
           worker.postMessage({ kill: 1 })
           worker.terminate()
           // clean workers from data structures
-          const myIndex = this.workers.indexOf(worker)
-          this.workers.splice(myIndex, 1)
+          const workerIndex = this.workers.indexOf(worker)
+          this.workers.splice(workerIndex, 1)
           this.tasks.delete(worker)
         }
       })