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
/
thread
/
dynamic.ts
diff --git
a/src/pools/thread/dynamic.ts
b/src/pools/thread/dynamic.ts
index 119e556dd2ccb454fec3ed9c89c20df5d76199c2..b0a22346690bd36c471b6b45c844af8ffae098ea 100644
(file)
--- a/
src/pools/thread/dynamic.ts
+++ b/
src/pools/thread/dynamic.ts
@@
-1,6
+1,7
@@
-import { type PoolType, PoolTypes } from '../pool'
+import { type Worker } from 'node:worker_threads'
+import { type PoolOptions, type PoolType, PoolTypes } from '../pool'
import { checkDynamicPoolSize } from '../utils'
import { checkDynamicPoolSize } from '../utils'
-import { FixedThreadPool
, type ThreadPoolOptions
} from './fixed'
+import { FixedThreadPool } from './fixed'
/**
* A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads.
/**
* A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads.
@@
-27,12
+28,15
@@
export class DynamicThreadPool<
*/
public constructor (
min: number,
*/
public constructor (
min: number,
-
protected readonly
max: number,
+ max: number,
filePath: string,
filePath: string,
- opts:
ThreadPoolOptions
= {}
+ 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 */