X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fthread%2Fdynamic.ts;h=b6d41e9ef9f7ff92cecf89e068c6493bafe696e3;hb=e8b3a5abad7d3ae4fa836ab0b76d54c1efd146e9;hp=00d25c0a5fd8d1060a575b9995c4e189475f15a5;hpb=6b27d40762317ec8502657663bdc839e358cda03;p=poolifier.git diff --git a/src/pools/thread/dynamic.ts b/src/pools/thread/dynamic.ts index 00d25c0a..b6d41e9e 100644 --- a/src/pools/thread/dynamic.ts +++ b/src/pools/thread/dynamic.ts @@ -1,5 +1,5 @@ -import { type PoolOptions, type PoolType, PoolTypes } from '../pool' -import { FixedThreadPool, type ThreadWorkerWithMessageChannel } from './fixed' +import { type PoolType, PoolTypes } from '../pool' +import { FixedThreadPool, type ThreadPoolOptions } from './fixed' /** * A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads. @@ -26,23 +26,18 @@ export class DynamicThreadPool< */ public constructor ( min: number, - public readonly max: number, + protected readonly max: number, filePath: string, - opts: PoolOptions = {} + opts: ThreadPoolOptions = {} ) { super(min, filePath, opts) } /** @inheritDoc */ - public get type (): PoolType { + protected get type (): PoolType { return PoolTypes.dynamic } - /** @inheritDoc */ - protected get full (): boolean { - return this.workerNodes.length >= this.max - } - /** @inheritDoc */ protected get maxSize (): number { return this.max