Merge pull request #811 from namandeep-123/move-readme-content-to-typedoc
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 8 Aug 2023 18:56:20 +0000 (20:56 +0200)
committerGitHub <noreply@github.com>
Tue, 8 Aug 2023 18:56:20 +0000 (20:56 +0200)
benchmarks/versus-external-pools/BENCH-100000.md
benchmarks/versus-external-pools/package.json
benchmarks/versus-external-pools/pnpm-lock.yaml
package.json
pnpm-lock.yaml
src/pools/abstract-pool.ts
src/utility-types.ts
src/worker/abstract-worker.ts

index 172a5659539e7f9ac3bd8db1aecf832ea4814794..674fc673e91d3802955d0490450063e74d0f57b2 100644 (file)
@@ -1,15 +1,15 @@
 | Command                                     |       Mean [s] | Min [s] | Max [s] |    Relative |
 | :------------------------------------------ | -------------: | ------: | ------: | ----------: |
-| `node dynamic-poolifier.mjs`                | 13.366 ± 0.271 |  12.951 |  13.982 |        1.00 |
-| `node fixed-poolifier.mjs`                  | 13.473 ± 0.324 |  13.173 |  14.417 | 1.01 ± 0.03 |
-| `node dynamic-piscina.mjs`                  | 16.299 ± 0.374 |  15.745 |  17.107 | 1.22 ± 0.04 |
-| `node fixed-piscina.mjs`                    | 16.401 ± 0.479 |  15.628 |  17.748 | 1.23 ± 0.04 |
-| `node dynamic-tinypool.mjs`                 | 16.439 ± 0.271 |  16.020 |  17.030 | 1.23 ± 0.03 |
-| `node fixed-tinypool.mjs`                   | 16.558 ± 0.401 |  15.786 |  17.249 | 1.24 ± 0.04 |
-| `node dynamic-workerpool.mjs`               | 17.448 ± 0.405 |  16.775 |  18.521 | 1.31 ± 0.04 |
-| `node fixed-workerpool.mjs`                 | 17.287 ± 0.378 |  16.805 |  18.335 | 1.29 ± 0.04 |
-| `node dynamic-worker-nodes.js`              | 17.991 ± 2.554 |  16.016 |  27.028 | 1.35 ± 0.19 |
-| `node fixed-worker-nodes.js`                | 17.211 ± 0.510 |  16.496 |  18.444 | 1.29 ± 0.05 |
-| `node dynamic-node-worker-threads-pool.mjs` | 24.718 ± 0.268 |  24.162 |  25.268 | 1.85 ± 0.04 |
-| `node static-node-worker-threads-pool.mjs`  | 17.132 ± 0.258 |  16.745 |  17.867 | 1.28 ± 0.03 |
-| `node fixed-nanothreads.mjs`                | 13.694 ± 0.275 |  13.465 |  14.470 | 1.02 ± 0.03 |
+| `node dynamic-poolifier.mjs`                | 13.233 ± 0.364 |  12.806 |  14.057 |        1.00 |
+| `node fixed-poolifier.mjs`                  | 13.297 ± 0.351 |  12.814 |  13.911 | 1.00 ± 0.04 |
+| `node dynamic-piscina.mjs`                  | 15.913 ± 0.481 |  15.189 |  17.310 | 1.20 ± 0.05 |
+| `node fixed-piscina.mjs`                    | 16.043 ± 0.331 |  15.608 |  16.603 | 1.21 ± 0.04 |
+| `node dynamic-tinypool.mjs`                 | 16.169 ± 0.376 |  15.666 |  17.091 | 1.22 ± 0.04 |
+| `node fixed-tinypool.mjs`                   | 16.089 ± 0.335 |  15.366 |  16.643 | 1.22 ± 0.04 |
+| `node dynamic-workerpool.mjs`               | 17.063 ± 0.368 |  16.381 |  17.712 | 1.29 ± 0.05 |
+| `node fixed-workerpool.mjs`                 | 17.190 ± 0.494 |  16.588 |  18.583 | 1.30 ± 0.05 |
+| `node dynamic-worker-nodes.js`              | 16.273 ± 0.416 |  15.740 |  17.196 | 1.23 ± 0.05 |
+| `node fixed-worker-nodes.js`                | 16.217 ± 0.257 |  15.853 |  16.901 | 1.23 ± 0.04 |
+| `node dynamic-node-worker-threads-pool.mjs` | 24.740 ± 0.451 |  24.090 |  25.704 | 1.87 ± 0.06 |
+| `node static-node-worker-threads-pool.mjs`  | 16.811 ± 0.305 |  16.473 |  17.440 | 1.27 ± 0.04 |
+| `node fixed-nanothreads.mjs`                | 13.542 ± 0.438 |  13.199 |  14.946 | 1.02 ± 0.04 |
index a7dd00be1488ebcfae6177f3c8b4c09fd0bb483d..cd3072e70aea4301593271c29b6268976e809e8d 100644 (file)
@@ -11,7 +11,7 @@
   },
   "volta": {
     "node": "18.17.0",
-    "pnpm": "8.6.11"
+    "pnpm": "8.6.12"
   },
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1"
@@ -19,8 +19,8 @@
   "dependencies": {
     "nanothreads": "0.3.7",
     "node-worker-threads-pool": "1.5.1",
-    "piscina": "4.0.0",
-    "poolifier": "2.6.20",
+    "piscina": "4.1.0",
+    "poolifier": "2.6.21",
     "tinypool": "0.7.0",
     "worker-nodes": "2.6.0",
     "workerpool": "6.4.0"
index 66b695d2066efc16841aab712fb76c7669b2bd84..fd8cf91917dbf2f902a5884d3b7d692525153dc6 100644 (file)
@@ -12,11 +12,11 @@ dependencies:
     specifier: 1.5.1
     version: 1.5.1
   piscina:
-    specifier: 4.0.0
-    version: 4.0.0
+    specifier: 4.1.0
+    version: 4.1.0
   poolifier:
-    specifier: 2.6.20
-    version: 2.6.20
+    specifier: 2.6.21
+    version: 2.6.21
   tinypool:
     specifier: 0.7.0
     version: 0.7.0
@@ -114,8 +114,8 @@ packages:
     resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==}
     dev: false
 
-  /piscina@4.0.0:
-    resolution: {integrity: sha512-641nAmJS4k4iqpNUqfggqUBUMmlw0ZoM5VZKdQkV2e970Inn3Tk9kroCc1wpsYLD07vCwpys5iY0d3xI/9WkTg==}
+  /piscina@4.1.0:
+    resolution: {integrity: sha512-sjbLMi3sokkie+qmtZpkfMCUJTpbxJm/wvaPzU28vmYSsTSW8xk9JcFUsbqGJdtPpIQ9tuj+iDcTtgZjwnOSig==}
     dependencies:
       eventemitter-asyncresource: 1.0.0
       hdr-histogram-js: 2.0.3
@@ -124,8 +124,8 @@ packages:
       nice-napi: 1.0.2
     dev: false
 
-  /poolifier@2.6.20:
-    resolution: {integrity: sha512-1s4Ylz09IU6o6NkYMGKmzM885VNpBzAdqPtoTZmpHkWT1Plyeh1L8VtmmS2nFWYapjSQ46H/Ypr6AeLc4mjkmg==}
+  /poolifier@2.6.21:
+    resolution: {integrity: sha512-TOTocb/Ek8UfZBvoJNWlEWSQJUv6In0GCGwMyI8W+WHfaS2ukkxwfYJE+AcVA9ezPfZTDso+AsqLVrs1acTWDA==}
     engines: {node: '>=16.14.0', pnpm: '>=8.6.0'}
     requiresBuild: true
     dev: false
index 7b6c548e49da4cd7dd5d50e9838e4aedd4da4e39..560465bdbc1acbf1d25ff7b10ae918a6c874ca21 100644 (file)
@@ -48,7 +48,7 @@
   },
   "volta": {
     "node": "20.5.0",
-    "pnpm": "8.6.11"
+    "pnpm": "8.6.12"
   },
   "repository": {
     "type": "git",
     "@release-it/keep-a-changelog": "^4.0.0",
     "@rollup/plugin-terser": "^0.4.3",
     "@rollup/plugin-typescript": "^11.1.2",
-    "@types/node": "^20.4.7",
+    "@types/node": "^20.4.8",
     "@typescript-eslint/eslint-plugin": "^5.62.0",
     "@typescript-eslint/parser": "^5.62.0",
     "benny": "^3.7.1",
     "eslint": "^8.46.0",
     "eslint-config-standard": "^17.1.0",
     "eslint-config-standard-with-typescript": "^37.0.0",
-    "eslint-define-config": "^1.22.0",
+    "eslint-define-config": "^1.23.0",
     "eslint-import-resolver-typescript": "^3.5.5",
     "eslint-plugin-import": "^2.28.0",
     "eslint-plugin-jsdoc": "^46.4.6",
index 522d723e86b3ecaf78d8df12ebd91362e392555d..0fe4354a99e5552a21f5fd9b75bf23819a36b5c6 100644 (file)
@@ -27,8 +27,8 @@ devDependencies:
     specifier: ^11.1.2
     version: 11.1.2(rollup@3.27.2)(typescript@5.1.6)
   '@types/node':
-    specifier: ^20.4.7
-    version: 20.4.7
+    specifier: ^20.4.8
+    version: 20.4.8
   '@typescript-eslint/eslint-plugin':
     specifier: ^5.62.0
     version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.46.0)(typescript@5.1.6)
@@ -51,8 +51,8 @@ devDependencies:
     specifier: ^37.0.0
     version: 37.0.0(@typescript-eslint/eslint-plugin@5.62.0)(eslint-plugin-import@2.28.0)(eslint-plugin-n@16.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.46.0)(typescript@5.1.6)
   eslint-define-config:
-    specifier: ^1.22.0
-    version: 1.22.0
+    specifier: ^1.23.0
+    version: 1.23.0
   eslint-import-resolver-typescript:
     specifier: ^3.5.5
     version: 3.5.5(@typescript-eslint/parser@5.62.0)(eslint-plugin-import@2.28.0)(eslint@8.46.0)
@@ -273,15 +273,15 @@ packages:
       '@commitlint/execute-rule': 17.4.0
       '@commitlint/resolve-extends': 17.6.7
       '@commitlint/types': 17.4.4
-      '@types/node': 20.4.7
+      '@types/node': 20.4.8
       chalk: 4.1.2
       cosmiconfig: 8.2.0
-      cosmiconfig-typescript-loader: 4.4.0(@types/node@20.4.7)(cosmiconfig@8.2.0)(ts-node@10.9.1)(typescript@5.1.6)
+      cosmiconfig-typescript-loader: 4.4.0(@types/node@20.4.8)(cosmiconfig@8.2.0)(ts-node@10.9.1)(typescript@5.1.6)
       lodash.isplainobject: 4.0.6
       lodash.merge: 4.6.2
       lodash.uniq: 4.5.0
       resolve-from: 5.0.0
-      ts-node: 10.9.1(@types/node@20.4.7)(typescript@5.1.6)
+      ts-node: 10.9.1(@types/node@20.4.8)(typescript@5.1.6)
       typescript: 5.1.6
     transitivePeerDependencies:
       - '@swc/core'
@@ -458,7 +458,7 @@ packages:
       '@jest/schemas': 29.6.0
       '@types/istanbul-lib-coverage': 2.0.4
       '@types/istanbul-reports': 3.0.1
-      '@types/node': 20.4.7
+      '@types/node': 20.4.8
       '@types/yargs': 17.0.24
       chalk: 4.1.2
     dev: true
@@ -763,7 +763,7 @@ packages:
         optional: true
     dependencies:
       '@rollup/pluginutils': 5.0.2(rollup@3.27.2)
-      resolve: 1.22.2
+      resolve: 1.22.4
       rollup: 3.27.2
       typescript: 5.1.6
     dev: true
@@ -857,7 +857,7 @@ packages:
     resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==}
     dependencies:
       '@types/minimatch': 5.1.2
-      '@types/node': 20.4.7
+      '@types/node': 20.4.8
     dev: true
 
   /@types/http-cache-semantics@4.0.1:
@@ -896,8 +896,8 @@ packages:
     resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==}
     dev: true
 
-  /@types/node@20.4.7:
-    resolution: {integrity: sha512-bUBrPjEry2QUTsnuEjzjbS7voGWCc30W0qzgMf90GPeDGFRakvrz47ju+oqDAKCXLUCe39u57/ORMl/O/04/9g==}
+  /@types/node@20.4.8:
+    resolution: {integrity: sha512-0mHckf6D2DiIAzh8fM8f3HQCvMKDpK94YQ0DSVkfWTG9BZleYIWudw9cJxX8oCk9bM+vAkDyujDV6dmKHbvQpg==}
     dev: true
 
   /@types/normalize-package-data@2.4.1:
@@ -1625,8 +1625,8 @@ packages:
       string-width: 5.1.2
     dev: true
 
-  /cli-width@4.0.0:
-    resolution: {integrity: sha512-ZksGS2xpa/bYkNzN3BAw1wEjsLV/ZKOf/CCrJ/QOBsxx6fOARIkwTutxp1XIOIohi6HKmOFjMoK/XaqDVUpEEw==}
+  /cli-width@4.1.0:
+    resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==}
     engines: {node: '>= 12'}
     dev: true
 
@@ -1764,7 +1764,7 @@ packages:
     resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==}
     dev: true
 
-  /cosmiconfig-typescript-loader@4.4.0(@types/node@20.4.7)(cosmiconfig@8.2.0)(ts-node@10.9.1)(typescript@5.1.6):
+  /cosmiconfig-typescript-loader@4.4.0(@types/node@20.4.8)(cosmiconfig@8.2.0)(ts-node@10.9.1)(typescript@5.1.6):
     resolution: {integrity: sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==}
     engines: {node: '>=v14.21.3'}
     peerDependencies:
@@ -1773,9 +1773,9 @@ packages:
       ts-node: '>=10'
       typescript: '>=4'
     dependencies:
-      '@types/node': 20.4.7
+      '@types/node': 20.4.8
       cosmiconfig: 8.2.0
-      ts-node: 10.9.1(@types/node@20.4.7)(typescript@5.1.6)
+      ts-node: 10.9.1(@types/node@20.4.8)(typescript@5.1.6)
       typescript: 5.1.6
     dev: true
 
@@ -2262,17 +2262,17 @@ packages:
       eslint-plugin-promise: 6.1.1(eslint@8.46.0)
     dev: true
 
-  /eslint-define-config@1.22.0:
-    resolution: {integrity: sha512-pckNJppFwC4AX+AGK63aa4sX5BluPwWwHES3fq/ER0jDR2U2czwlngg38B4EQ2ibvofufc+R5QfmdPKI6+74vQ==}
+  /eslint-define-config@1.23.0:
+    resolution: {integrity: sha512-4mMyu0JuBkQHsCtR+42irIQdFLmLIW+pMAVcyOV/gZRL4O1R8iuH0eMG3oL3Cbi1eo9fDAfT5CIHVHgdyxcf6w==}
     engines: {node: ^16.13.0 || >=18.0.0, npm: '>=7.0.0', pnpm: '>= 8.6.0'}
     dev: true
 
-  /eslint-import-resolver-node@0.3.7:
-    resolution: {integrity: sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==}
+  /eslint-import-resolver-node@0.3.8:
+    resolution: {integrity: sha512-tEe+Pok22qIGaK3KoMP+N96GVDS66B/zreoVVmiavLvRUEmGRtvb4B8wO9jwnb8d2lvHtrkhZ7UD73dWBVnf/Q==}
     dependencies:
       debug: 3.2.7
-      is-core-module: 2.12.1
-      resolve: 1.22.2
+      is-core-module: 2.13.0
+      resolve: 1.22.4
     transitivePeerDependencies:
       - supports-color
     dev: true
@@ -2287,11 +2287,11 @@ packages:
       debug: 4.3.4(supports-color@8.1.1)
       enhanced-resolve: 5.15.0
       eslint: 8.46.0
-      eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0)
+      eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.8)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0)
       eslint-plugin-import: 2.28.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0)
       get-tsconfig: 4.6.2
       globby: 13.2.2
-      is-core-module: 2.12.1
+      is-core-module: 2.13.0
       is-glob: 4.0.3
       synckit: 0.8.5
     transitivePeerDependencies:
@@ -2301,7 +2301,7 @@ packages:
       - supports-color
     dev: true
 
-  /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0):
+  /eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.8)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0):
     resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==}
     engines: {node: '>=4'}
     peerDependencies:
@@ -2325,7 +2325,7 @@ packages:
       '@typescript-eslint/parser': 5.62.0(eslint@8.46.0)(typescript@5.1.6)
       debug: 3.2.7
       eslint: 8.46.0
-      eslint-import-resolver-node: 0.3.7
+      eslint-import-resolver-node: 0.3.8
       eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/parser@5.62.0)(eslint-plugin-import@2.28.0)(eslint@8.46.0)
     transitivePeerDependencies:
       - supports-color
@@ -2371,16 +2371,16 @@ packages:
       debug: 3.2.7
       doctrine: 2.1.0
       eslint: 8.46.0
-      eslint-import-resolver-node: 0.3.7
-      eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.7)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0)
+      eslint-import-resolver-node: 0.3.8
+      eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.8)(eslint-import-resolver-typescript@3.5.5)(eslint@8.46.0)
       has: 1.0.3
-      is-core-module: 2.12.1
+      is-core-module: 2.13.0
       is-glob: 4.0.3
       minimatch: 3.1.2
       object.fromentries: 2.0.6
       object.groupby: 1.0.0
       object.values: 1.1.6
-      resolve: 1.22.3
+      resolve: 1.22.4
       semver: 7.5.4
       tsconfig-paths: 3.14.2
     transitivePeerDependencies:
@@ -2420,9 +2420,9 @@ packages:
       eslint-plugin-es: 4.1.0(eslint@8.46.0)
       eslint-utils: 3.0.0(eslint@8.46.0)
       ignore: 5.2.4
-      is-core-module: 2.12.1
+      is-core-module: 2.13.0
       minimatch: 3.1.2
-      resolve: 1.22.2
+      resolve: 1.22.4
       semver: 7.5.4
     dev: true
 
@@ -2437,9 +2437,9 @@ packages:
       eslint: 8.46.0
       eslint-plugin-es-x: 7.2.0(eslint@8.46.0)
       ignore: 5.2.4
-      is-core-module: 2.12.1
+      is-core-module: 2.13.0
       minimatch: 3.1.2
-      resolve: 1.22.2
+      resolve: 1.22.4
       semver: 7.5.4
     dev: true
 
@@ -2686,7 +2686,7 @@ packages:
     engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
     dependencies:
       '@jest/expect-utils': 29.6.2
-      '@types/node': 20.4.7
+      '@types/node': 20.4.8
       jest-get-type: 29.4.3
       jest-matcher-utils: 29.6.2
       jest-message-util: 29.6.2
@@ -3322,7 +3322,7 @@ packages:
       ansi-escapes: 4.3.2
       chalk: 5.3.0
       cli-cursor: 3.1.0
-      cli-width: 4.0.0
+      cli-width: 4.1.0
       external-editor: 3.1.0
       figures: 5.0.0
       lodash: 4.17.21
@@ -3418,8 +3418,8 @@ packages:
       ci-info: 3.8.0
     dev: true
 
-  /is-core-module@2.12.1:
-    resolution: {integrity: sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==}
+  /is-core-module@2.13.0:
+    resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==}
     dependencies:
       has: 1.0.3
     dev: true
@@ -3742,7 +3742,7 @@ packages:
     engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
     dependencies:
       '@jest/types': 29.6.1
-      '@types/node': 20.4.7
+      '@types/node': 20.4.8
       chalk: 4.1.2
       ci-info: 3.8.0
       graceful-fs: 4.2.11
@@ -4406,7 +4406,7 @@ packages:
     resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==}
     dependencies:
       hosted-git-info: 2.8.9
-      resolve: 1.22.2
+      resolve: 1.22.4
       semver: 7.5.4
       validate-npm-package-license: 3.0.4
     dev: true
@@ -4416,7 +4416,7 @@ packages:
     engines: {node: '>=10'}
     dependencies:
       hosted-git-info: 4.1.0
-      is-core-module: 2.12.1
+      is-core-module: 2.13.0
       semver: 7.5.4
       validate-npm-package-license: 3.0.4
     dev: true
@@ -4994,7 +4994,7 @@ packages:
     resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==}
     engines: {node: '>= 0.10'}
     dependencies:
-      resolve: 1.22.2
+      resolve: 1.22.4
     dev: true
 
   /redent@3.0.0:
@@ -5108,24 +5108,15 @@ packages:
   /resolve@1.19.0:
     resolution: {integrity: sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==}
     dependencies:
-      is-core-module: 2.12.1
+      is-core-module: 2.13.0
       path-parse: 1.0.7
     dev: true
 
-  /resolve@1.22.2:
-    resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==}
+  /resolve@1.22.4:
+    resolution: {integrity: sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==}
     hasBin: true
     dependencies:
-      is-core-module: 2.12.1
-      path-parse: 1.0.7
-      supports-preserve-symlinks-flag: 1.0.0
-    dev: true
-
-  /resolve@1.22.3:
-    resolution: {integrity: sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==}
-    hasBin: true
-    dependencies:
-      is-core-module: 2.12.1
+      is-core-module: 2.13.0
       path-parse: 1.0.7
       supports-preserve-symlinks-flag: 1.0.0
     dev: true
@@ -5134,7 +5125,7 @@ packages:
     resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==}
     hasBin: true
     dependencies:
-      is-core-module: 2.12.1
+      is-core-module: 2.13.0
       path-parse: 1.0.7
       supports-preserve-symlinks-flag: 1.0.0
     dev: true
@@ -5706,7 +5697,7 @@ packages:
     engines: {node: '>=8'}
     dev: true
 
-  /ts-node@10.9.1(@types/node@20.4.7)(typescript@5.1.6):
+  /ts-node@10.9.1(@types/node@20.4.8)(typescript@5.1.6):
     resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
     hasBin: true
     peerDependencies:
@@ -5725,7 +5716,7 @@ packages:
       '@tsconfig/node12': 1.0.11
       '@tsconfig/node14': 1.0.3
       '@tsconfig/node16': 1.0.4
-      '@types/node': 20.4.7
+      '@types/node': 20.4.8
       acorn: 8.10.0
       acorn-walk: 8.2.0
       arg: 4.1.3
index 57c50861879c9a4225c502898958b9d33a4bbaa6..aec731a5c189903b46230ceceeb831768fa62425 100644 (file)
@@ -639,9 +639,9 @@ export abstract class AbstractPool<
         data: data ?? ({} as Data),
         timestamp,
         workerId: this.getWorkerInfo(workerNodeKey).id as number,
-        id: randomUUID()
+        taskId: randomUUID()
       }
-      this.promiseResponseMap.set(task.id as string, {
+      this.promiseResponseMap.set(task.taskId as string, {
         resolve,
         reject,
         workerNodeKey
@@ -1037,7 +1037,7 @@ export abstract class AbstractPool<
       if (message.ready != null) {
         // Worker ready response received from worker
         this.handleWorkerReadyResponse(message)
-      } else if (message.id != null) {
+      } else if (message.taskId != null) {
         // Task execution response received from worker
         this.handleTaskExecutionResponse(message)
       }
@@ -1054,7 +1054,9 @@ export abstract class AbstractPool<
   }
 
   private handleTaskExecutionResponse (message: MessageValue<Response>): void {
-    const promiseResponse = this.promiseResponseMap.get(message.id as string)
+    const promiseResponse = this.promiseResponseMap.get(
+      message.taskId as string
+    )
     if (promiseResponse != null) {
       if (message.taskError != null) {
         this.emitter?.emit(PoolEvents.taskError, message.taskError)
@@ -1064,7 +1066,7 @@ export abstract class AbstractPool<
       }
       const workerNodeKey = promiseResponse.workerNodeKey
       this.afterTaskExecutionHook(workerNodeKey, message)
-      this.promiseResponseMap.delete(message.id as string)
+      this.promiseResponseMap.delete(message.taskId as string)
       if (
         this.opts.enableTasksQueue === true &&
         this.tasksQueueSize(workerNodeKey) > 0 &&
index be0ed287633b24e211e46024f736aefc033701e3..123b5d6ea4fa397982c6195de0d9ccd95ba0c1df 100644 (file)
@@ -80,9 +80,9 @@ export interface Task<Data = unknown> {
    */
   readonly timestamp?: number
   /**
-   * Message UUID.
+   * Task UUID.
    */
-  readonly id?: string
+  readonly taskId?: string
 }
 
 /**
index 381e4d9a7357ec70ed425fa4ab9d3ae990a775a7..64627efb8823198c6cb09c81fbdded3bef046f01 100644 (file)
@@ -293,7 +293,9 @@ export abstract class AbstractWorker<
    * @param message - The received message.
    */
   protected messageListener (message: MessageValue<Data>): void {
-    if (message.workerId === this.id) {
+    if (message.workerId != null && message.workerId !== this.id) {
+      throw new Error('Message worker id does not match worker id')
+    } else if (message.workerId === this.id) {
       if (message.statistics != null) {
         // Statistics message received
         this.statistics = message.statistics
@@ -302,7 +304,7 @@ export abstract class AbstractWorker<
         !this.isMain && message.checkActive
           ? this.startCheckActive()
           : this.stopCheckActive()
-      } else if (message.id != null && message.data != null) {
+      } else if (message.taskId != null && message.data != null) {
         // Task message received
         this.run(message)
       } else if (message.kill === true) {
@@ -422,7 +424,7 @@ export abstract class AbstractWorker<
         data: res,
         taskPerformance,
         workerId: this.id,
-        id: task.id
+        taskId: task.taskId
       })
     } catch (e) {
       const errorMessage = this.handleError(e as Error | string)
@@ -433,7 +435,7 @@ export abstract class AbstractWorker<
           data: task.data
         },
         workerId: this.id,
-        id: task.id
+        taskId: task.taskId
       })
     } finally {
       this.updateLastTaskTimestamp()
@@ -458,7 +460,7 @@ export abstract class AbstractWorker<
           data: res,
           taskPerformance,
           workerId: this.id,
-          id: task.id
+          taskId: task.taskId
         })
         return null
       })
@@ -471,7 +473,7 @@ export abstract class AbstractWorker<
             data: task.data
           },
           workerId: this.id,
-          id: task.id
+          taskId: task.taskId
         })
       })
       .finally(() => {