@travetto/worker
Advanced tools
Comparing version 4.0.0-rc.3 to 4.0.0-rc.4
{ | ||
"name": "@travetto/worker", | ||
"version": "4.0.0-rc.3", | ||
"version": "4.0.0-rc.4", | ||
"description": "Process management utilities, with a focus on inter-process communication", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@travetto/base": "^4.0.0-rc.3", | ||
"@travetto/base": "^4.0.0-rc.4", | ||
"generic-pool": "^3.9.0" | ||
@@ -31,0 +31,0 @@ }, |
@@ -1,4 +0,4 @@ | ||
import gp from 'generic-pool'; | ||
import os from 'node:os'; | ||
import timers from 'node:timers/promises'; | ||
import { Options, Pool, createPool } from 'generic-pool'; | ||
@@ -24,3 +24,3 @@ import { Env, Util } from '@travetto/base'; | ||
type WorkerInput<I, O> = (() => Worker<I, O>) | ((input: I, inputIdx: number) => Promise<O>); | ||
type WorkPoolConfig<I, O> = gp.Options & { | ||
type WorkPoolConfig<I, O> = Options & { | ||
onComplete?: (output: O, input: I, finishIdx: number) => void; | ||
@@ -42,3 +42,3 @@ onError?(ev: Error, input: I, finishIdx: number): (unknown | Promise<unknown>); | ||
/** Build worker pool */ | ||
static #buildPool<I, O>(worker: WorkerInput<I, O>, opts?: WorkPoolConfig<I, O>): gp.Pool<Worker<I, O>> { | ||
static #buildPool<I, O>(worker: WorkerInput<I, O>, opts?: WorkPoolConfig<I, O>): Pool<Worker<I, O>> { | ||
let pendingAcquires = 0; | ||
@@ -49,3 +49,3 @@ | ||
// Create the pool | ||
const pool = gp.createPool({ | ||
const pool = createPool({ | ||
async create() { | ||
@@ -52,0 +52,0 @@ try { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19570
Updated@travetto/base@^4.0.0-rc.4