Apply dependencies update
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 3 Jan 2023 20:52:46 +0000 (21:52 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 3 Jan 2023 20:52:46 +0000 (21:52 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
examples/typescript/pool.ts
package-lock.json
package.json
src/pools/abstract-pool.ts

index be92f73bf763afbe7b408ae5c5026c44b6ec3c2b..c2d0a1b8d1f1ba004993d820f8dcdef28f3bd7aa 100644 (file)
@@ -6,8 +6,12 @@ export const fixedPool = new FixedThreadPool<MyData, Promise<MyResponse>>(
   8,
   join(__dirname, 'worker.js'),
   {
-    errorHandler: (e: Error) => console.error(e),
-    onlineHandler: () => console.log('Worker is online')
+    errorHandler: (e: Error) => {
+      console.error(e)
+    },
+    onlineHandler: () => {
+      console.log('Worker is online')
+    }
   }
 )
 
@@ -16,7 +20,11 @@ export const dynamicPool = new DynamicThreadPool<MyData, Promise<MyResponse>>(
   8,
   join(__dirname, 'worker.js'),
   {
-    errorHandler: (e: Error) => console.error(e),
-    onlineHandler: () => console.log('Worker is online')
+    errorHandler: (e: Error) => {
+      console.error(e)
+    },
+    onlineHandler: () => {
+      console.log('Worker is online')
+    }
   }
 )
index 65c26933dfe7ecfdf375011ed51615f6061d5a79..85940c3a248ca708b2f01982d8a69d3c999609ed 100644 (file)
@@ -24,7 +24,7 @@
         "c8": "^7.12.0",
         "eslint": "^8.31.0",
         "eslint-config-standard": "^17.0.0",
-        "eslint-config-standard-with-typescript": "^24.0.0",
+        "eslint-config-standard-with-typescript": "^26.0.0",
         "eslint-define-config": "^1.13.0",
         "eslint-import-resolver-typescript": "^3.5.2",
         "eslint-plugin-import": "^2.26.0",
@@ -34,7 +34,7 @@
         "eslint-plugin-spellcheck": "^0.0.20",
         "eslint-plugin-tsdoc": "^0.2.17",
         "expect": "^29.3.1",
-        "husky": "^8.0.2",
+        "husky": "^8.0.3",
         "lint-staged": "^13.1.0",
         "microtime": "^3.1.1",
         "mocha": "^10.2.0",
       }
     },
     "node_modules/eslint-config-standard-with-typescript": {
-      "version": "24.0.0",
-      "resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-24.0.0.tgz",
-      "integrity": "sha512-vEnGXZ5aiR1enl9652iIP4nTpY3GPcNEwuhrsPbKO3Ce3D6T3yCqZdkUPk8nJetfdL/yO0DLsHg2d/l9iECIdg==",
+      "version": "26.0.0",
+      "resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-26.0.0.tgz",
+      "integrity": "sha512-TluIWunQo76qp4MHyYIaTT+sN2q2v/jTeE3Dj4rXsSbx27GOUEOujhJaAL3v9dHVQelAK13gZ5Jy9IWnWCyFrg==",
       "dev": true,
       "dependencies": {
         "@typescript-eslint/parser": "^5.0.0",
       }
     },
     "node_modules/husky": {
-      "version": "8.0.2",
-      "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.2.tgz",
-      "integrity": "sha512-Tkv80jtvbnkK3mYWxPZePGFpQ/tT3HNSs/sasF9P2YfkMezDl3ON37YN6jUUI4eTg5LcyVynlb6r4eyvOmspvg==",
+      "version": "8.0.3",
+      "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz",
+      "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==",
       "dev": true,
       "bin": {
         "husky": "lib/bin.js"
       "dev": true
     },
     "eslint-config-standard-with-typescript": {
-      "version": "24.0.0",
-      "resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-24.0.0.tgz",
-      "integrity": "sha512-vEnGXZ5aiR1enl9652iIP4nTpY3GPcNEwuhrsPbKO3Ce3D6T3yCqZdkUPk8nJetfdL/yO0DLsHg2d/l9iECIdg==",
+      "version": "26.0.0",
+      "resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-26.0.0.tgz",
+      "integrity": "sha512-TluIWunQo76qp4MHyYIaTT+sN2q2v/jTeE3Dj4rXsSbx27GOUEOujhJaAL3v9dHVQelAK13gZ5Jy9IWnWCyFrg==",
       "dev": true,
       "requires": {
         "@typescript-eslint/parser": "^5.0.0",
       "dev": true
     },
     "husky": {
-      "version": "8.0.2",
-      "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.2.tgz",
-      "integrity": "sha512-Tkv80jtvbnkK3mYWxPZePGFpQ/tT3HNSs/sasF9P2YfkMezDl3ON37YN6jUUI4eTg5LcyVynlb6r4eyvOmspvg==",
+      "version": "8.0.3",
+      "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz",
+      "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==",
       "dev": true
     },
     "iconv-lite": {
index d04753264147189d9354677f07566ed73c40c1f2..2848ef1b7b4e9cf6e99e462e2d3fd29a5fff6dc1 100644 (file)
@@ -93,7 +93,7 @@
     "c8": "^7.12.0",
     "eslint": "^8.31.0",
     "eslint-config-standard": "^17.0.0",
-    "eslint-config-standard-with-typescript": "^24.0.0",
+    "eslint-config-standard-with-typescript": "^26.0.0",
     "eslint-define-config": "^1.13.0",
     "eslint-import-resolver-typescript": "^3.5.2",
     "eslint-plugin-import": "^2.26.0",
     "eslint-plugin-spellcheck": "^0.0.20",
     "eslint-plugin-tsdoc": "^0.2.17",
     "expect": "^29.3.1",
-    "husky": "^8.0.2",
+    "husky": "^8.0.3",
     "lint-staged": "^13.1.0",
     "microtime": "^3.1.1",
     "mocha": "^10.2.0",
index c2b54b58d0b24171f26c611d0655016afca29849..1cd6c56f61942bc911d6969b53ae63f1d28f5ddf 100644 (file)
@@ -336,7 +336,9 @@ export abstract class AbstractPool<
     worker.on('error', this.opts.errorHandler ?? EMPTY_FUNCTION)
     worker.on('online', this.opts.onlineHandler ?? EMPTY_FUNCTION)
     worker.on('exit', this.opts.exitHandler ?? EMPTY_FUNCTION)
-    worker.once('exit', () => this.removeWorker(worker))
+    worker.once('exit', () => {
+      this.removeWorker(worker)
+    })
 
     this.workers.push(worker)