X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Fdynamic.ts;h=32aad22a738c8541a4147ebbad7a3048ff51f8af;hb=55d7d6002049be09a06b08da26febe2e8bfa494b;hp=b93d7e87c4290a21b8a9b8f7c2845647d05592da;hpb=a25c335d7e5573a171fc96c445cb6092852b2c4a;p=poolifier.git diff --git a/src/pools/cluster/dynamic.ts b/src/pools/cluster/dynamic.ts index b93d7e87..32aad22a 100644 --- a/src/pools/cluster/dynamic.ts +++ b/src/pools/cluster/dynamic.ts @@ -1,5 +1,7 @@ -import { type PoolType, PoolTypes } from '../pool' -import { type ClusterPoolOptions, FixedClusterPool } from './fixed' +import { type Worker } from 'node:cluster' +import { type PoolOptions, type PoolType, PoolTypes } from '../pool' +import { checkDynamicPoolSize } from '../utils' +import { FixedClusterPool } from './fixed' /** * A cluster pool with a dynamic number of workers, but a guaranteed minimum number of workers. @@ -28,10 +30,10 @@ export class DynamicClusterPool< min: number, protected readonly max: number, filePath: string, - opts: ClusterPoolOptions = {} + opts: PoolOptions = {} ) { super(min, filePath, opts) - this.checkDynamicPoolSize(this.numberOfWorkers, this.max) + checkDynamicPoolSize(this.numberOfWorkers, this.max) } /** @inheritDoc */