X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=d644f2298000fe1b6176f335ff228e51483e9144;hb=0770fe626b2bb3212a1d73fa4764973ac92e241a;hp=092e97781911ec89ab1e16c5e2af0ca485fe1174;hpb=4f3c3d894171421375559b43ce469bd5ccb475da;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index 092e9778..d644f229 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -1,7 +1,6 @@ -import type { ClusterSettings, Worker } from 'cluster' -import cluster from 'cluster' +import type { ClusterSettings, Worker } from 'node:cluster' +import cluster from 'node:cluster' import type { MessageValue } from '../../utility-types' -import { EMPTY_OBJECT_LITERAL } from '../../utils' import { AbstractPool } from '../abstract-pool' import type { PoolOptions } from '../pool' import { PoolType } from '../pool-internal' @@ -51,7 +50,7 @@ export class FixedClusterPool< public constructor ( numberOfWorkers: number, filePath: string, - public readonly opts: ClusterPoolOptions = EMPTY_OBJECT_LITERAL + public readonly opts: ClusterPoolOptions = {} ) { super(numberOfWorkers, filePath, opts) } @@ -101,8 +100,13 @@ export class FixedClusterPool< return PoolType.FIXED } + /** {@inheritDoc} */ + public get full (): boolean { + return this.workers.length === this.numberOfWorkers + } + /** {@inheritDoc} */ public get busy (): boolean { - return this.internalGetBusyStatus() + return this.internalBusy() } }