From c32882b0f88f2025112eabdeaecbb56d0fb92ca4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 19 Feb 2021 21:20:05 +0100 Subject: [PATCH] Update to poolifier 2.0.0-beta.6 (#10) --- package-lock.json | 12 ++++++------ package.json | 4 ++-- src/worker/WorkerDynamicPool.ts | 5 +++-- src/worker/WorkerStaticPool.ts | 5 +++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9422b336..991202c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -700,9 +700,9 @@ "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": { @@ -7322,9 +7322,9 @@ } }, "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", diff --git a/package.json b/package.json index e7d87c38..0732b065 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/worker/WorkerDynamicPool.ts b/src/worker/WorkerDynamicPool.ts index aa3542b2..0cbefdf6 100644 --- a/src/worker/WorkerDynamicPool.ts +++ b/src/worker/WorkerDynamicPool.ts @@ -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 extends Wrk { class DynamicPool extends DynamicThreadPool { private static instance: DynamicPool; - private constructor(min: number, max: number, filename: string, opts?: DynamicThreadPoolOptions) { + private constructor(min: number, max: number, filename: string, opts?: PoolOptions) { super(min, max, filename, opts); } diff --git a/src/worker/WorkerStaticPool.ts b/src/worker/WorkerStaticPool.ts index 1de7cba2..3a144c35 100644 --- a/src/worker/WorkerStaticPool.ts +++ b/src/worker/WorkerStaticPool.ts @@ -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 extends Wrk { class StaticPool extends FixedThreadPool { private static instance: StaticPool; - private constructor(numThreads: number, workerScript: string, opts?: FixedThreadPoolOptions) { + private constructor(numThreads: number, workerScript: string, opts?: PoolOptions) { super(numThreads, workerScript, opts); } -- 2.34.1