repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge dependabot/npm_and_yarn/examples/typescript/websocket-server-pool/ws-worker_thr...
[poolifier.git]
/
src
/
pools
/
cluster
/
dynamic.ts
diff --git
a/src/pools/cluster/dynamic.ts
b/src/pools/cluster/dynamic.ts
index 99a89966e914507fa6868883a0f67c751c8b29c6..9f2f0dd95130a37d4bf010b071dbcc30271ab9ac 100644
(file)
--- a/
src/pools/cluster/dynamic.ts
+++ b/
src/pools/cluster/dynamic.ts
@@
-1,6
+1,7
@@
-import { type PoolType, PoolTypes } from '../pool'
+import { type Worker } from 'node:cluster'
+import { type PoolOptions, type PoolType, PoolTypes } from '../pool'
import { checkDynamicPoolSize } from '../utils'
import { checkDynamicPoolSize } from '../utils'
-import {
type ClusterPoolOptions,
FixedClusterPool } from './fixed'
+import { FixedClusterPool } from './fixed'
/**
* A cluster pool with a dynamic number of workers, but a guaranteed minimum number of workers.
/**
* A cluster pool with a dynamic number of workers, but a guaranteed minimum number of workers.
@@
-27,12
+28,15
@@
export class DynamicClusterPool<
*/
public constructor (
min: number,
*/
public constructor (
min: number,
-
protected readonly
max: number,
+ max: number,
filePath: string,
filePath: string,
- opts:
ClusterPoolOptions
= {}
+ opts:
PoolOptions<Worker>
= {}
) {
) {
- super(min, filePath, opts)
- checkDynamicPoolSize(this.numberOfWorkers, this.max)
+ super(min, filePath, opts, max)
+ checkDynamicPoolSize(
+ this.minimumNumberOfWorkers,
+ this.maximumNumberOfWorkers as number
+ )
}
/** @inheritDoc */
}
/** @inheritDoc */