X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpools%2Fthread%2Fdynamic.ts;h=7bf477dd837c0ce3e30cb65ad308c32ca0774f48;hb=aec509b85e7d73e9883c8885e27fc4e34fdaef1e;hp=62ddba9fc4792148a47f69c51c8c6f7a01b3adb0;hpb=afc003b20097712625ffd053e256ef5336e27b6e;p=poolifier.git diff --git a/src/pools/thread/dynamic.ts b/src/pools/thread/dynamic.ts index 62ddba9f..7bf477dd 100644 --- a/src/pools/thread/dynamic.ts +++ b/src/pools/thread/dynamic.ts @@ -1,5 +1,5 @@ import type { PoolOptions } from '../pool' -import { PoolType } from '../pool-internal' +import { PoolType } from '../pool' import type { ThreadWorkerWithMessageChannel } from './fixed' import { FixedThreadPool } from './fixed' @@ -28,7 +28,7 @@ export class DynamicThreadPool< */ public constructor ( min: number, - private readonly max: number, + public readonly max: number, filePath: string, opts: PoolOptions = {} ) { @@ -41,12 +41,12 @@ export class DynamicThreadPool< } /** @inheritDoc */ - public get full (): boolean { - return this.workers.length === this.max + protected get full (): boolean { + return this.workerNodes.length === this.max } /** @inheritDoc */ - public get busy (): boolean { - return this.full && this.findFreeWorkerKey() === -1 + protected get busy (): boolean { + return this.full && this.internalBusy() } }