Update to poolifier 2.0.0-beta.6 (#10)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 19 Feb 2021 20:20:05 +0000 (21:20 +0100)
committerGitHub <noreply@github.com>
Fri, 19 Feb 2021 20:20:05 +0000 (21:20 +0100)
package-lock.json
package.json
src/worker/WorkerDynamicPool.ts
src/worker/WorkerStaticPool.ts

index 9422b33604296c2245cd4354d6ed7e7902fb07f4..991202c21b267e927d9881c9c1bd348a9f401ac5 100644 (file)
       "dev": true
     },
     "@types/node": {
-      "version": "14.14.30",
-      "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.30.tgz",
-      "integrity": "sha512-gUWhy8s45fQp4PqqKecsnOkdW0kt1IaKjgOIR3HPokkzTmQj9ji2wWFID5THu1MKrtO+d4s2lVrlEhXUsPXSvg==",
+      "version": "14.14.31",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.31.tgz",
+      "integrity": "sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==",
       "dev": true
     },
     "@types/offscreencanvas": {
       }
     },
     "poolifier": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/poolifier/-/poolifier-1.2.1.tgz",
-      "integrity": "sha512-kUH3JlLLO7JdAnRdtbgaSME5WDxgDzAuUk9+hapVHfXeI0VjpeuLnxLL8cUF7lEgrUE4m59scr5TFx5ajbPqXQ=="
+      "version": "2.0.0-beta.6",
+      "resolved": "https://registry.npmjs.org/poolifier/-/poolifier-2.0.0-beta.6.tgz",
+      "integrity": "sha512-n+IumaVITBY1/UD4gC4e6uXHlBIgy2+AKeX4BmhEP4phIM6DCYBYBRuVk5lk8LlXKiO8HFrQ3WXHzCpubqWyqA=="
     },
     "postcss": {
       "version": "8.1.10",
index e7d87c388b5283eda11e643de32dd8eaf654e476..0732b06540188029b9ea29aeab48b4067b84a623 100644 (file)
@@ -48,7 +48,7 @@
   },
   "dependencies": {
     "mongodb": "^3.6.4",
-    "poolifier": "^1.2.1",
+    "poolifier": "^2.0.0-beta.6",
     "source-map-support": "^0.5.19",
     "tslib": "^2.1.0",
     "uuid": "^8.3.2",
@@ -61,7 +61,7 @@
     "utf-8-validate": "^5.0.4"
   },
   "devDependencies": {
-    "@types/node": "^14.14.30",
+    "@types/node": "^14.14.31",
     "@types/uuid": "^8.3.0",
     "@types/ws": "^7.4.0",
     "@typescript-eslint/eslint-plugin": "^4.15.1",
index aa3542b26386f72e75c39eb589656e3f9009e1ca..0cbefdf66ed455b8ccc924384129b7a184361c18 100644 (file)
@@ -1,7 +1,8 @@
-import { DynamicThreadPool, DynamicThreadPoolOptions } from 'poolifier';
+import { DynamicThreadPool, PoolOptions } from 'poolifier';
 
 import Constants from '../utils/Constants';
 import Utils from '../utils/Utils';
+import { Worker } from 'worker_threads';
 import { WorkerData } from '../types/Worker';
 import Wrk from './Wrk';
 
@@ -58,7 +59,7 @@ export default class WorkerDynamicPool<T> extends Wrk {
 class DynamicPool extends DynamicThreadPool<WorkerData> {
   private static instance: DynamicPool;
 
-  private constructor(min: number, max: number, filename: string, opts?: DynamicThreadPoolOptions) {
+  private constructor(min: number, max: number, filename: string, opts?: PoolOptions<Worker>) {
     super(min, max, filename, opts);
   }
 
index 1de7cba23304a7f3812dd906a9c64162a3f39dc9..3a144c35ac7fa5464db448967a83beafaa0c462e 100644 (file)
@@ -1,7 +1,8 @@
-import { FixedThreadPool, FixedThreadPoolOptions } from 'poolifier';
+import { FixedThreadPool, PoolOptions } from 'poolifier';
 
 import Constants from '../utils/Constants';
 import Utils from '../utils/Utils';
+import { Worker } from 'worker_threads';
 import { WorkerData } from '../types/Worker';
 import Wrk from './Wrk';
 
@@ -58,7 +59,7 @@ export default class WorkerStaticPool<T> extends Wrk {
 class StaticPool extends FixedThreadPool<WorkerData> {
   private static instance: StaticPool;
 
-  private constructor(numThreads: number, workerScript: string, opts?: FixedThreadPoolOptions) {
+  private constructor(numThreads: number, workerScript: string, opts?: PoolOptions<Worker>) {
     super(numThreads, workerScript, opts);
   }