X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fthread%2Ffixed.ts;h=41fcee2b60c2c5a36b5f24bc35d1cdce4a03c326;hb=dab8c377b70fc962ec217f2aeb719842f9f94cd6;hp=7753d1d60cb21910a5f871338889023ef4de12c1;hpb=ef41a6e6f04e66c9732334e673758b2f4e4b0730;p=poolifier.git diff --git a/src/pools/thread/fixed.ts b/src/pools/thread/fixed.ts index 7753d1d6..41fcee2b 100644 --- a/src/pools/thread/fixed.ts +++ b/src/pools/thread/fixed.ts @@ -1,8 +1,8 @@ import { - isMainThread, MessageChannel, SHARE_ENV, - Worker + Worker, + isMainThread } from 'node:worker_threads' import type { Draft, MessageValue } from '../../utility-types' import { AbstractPool } from '../abstract-pool' @@ -96,6 +96,11 @@ export class FixedThreadPool< return PoolType.FIXED } + /** @inheritDoc */ + public get size (): number { + return this.numberOfWorkers + } + /** @inheritDoc */ protected get full (): boolean { return this.workerNodes.length === this.numberOfWorkers