From: Jérôme Benoit Date: Sun, 4 Jun 2023 11:18:43 +0000 (+0200) Subject: refactor: limit pool internals public exposure X-Git-Tag: v2.5.3~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b4213b7fc45201c5a38f2615289c569b679a15b7;p=poolifier.git refactor: limit pool internals public exposure Signed-off-by: Jérôme Benoit --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 134b1745..25e56033 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Refine pool information content. +- Limit pool internals public exposure. ## [2.5.2] - 2023-06-02 diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 538d66c7..5d7e8cd8 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -78,9 +78,9 @@ export abstract class AbstractPool< * @param opts - Options for the pool. */ public constructor ( - public readonly numberOfWorkers: number, - public readonly filePath: string, - public readonly opts: PoolOptions + protected readonly numberOfWorkers: number, + protected readonly filePath: string, + protected readonly opts: PoolOptions ) { if (!this.isMain()) { throw new Error('Cannot start a pool from a worker!') diff --git a/src/pools/cluster/dynamic.ts b/src/pools/cluster/dynamic.ts index cae99700..eb86ba85 100644 --- a/src/pools/cluster/dynamic.ts +++ b/src/pools/cluster/dynamic.ts @@ -26,7 +26,7 @@ export class DynamicClusterPool< */ public constructor ( min: number, - public readonly max: number, + protected readonly max: number, filePath: string, opts: ClusterPoolOptions = {} ) { diff --git a/src/pools/thread/dynamic.ts b/src/pools/thread/dynamic.ts index 04931b74..8cdb0d5c 100644 --- a/src/pools/thread/dynamic.ts +++ b/src/pools/thread/dynamic.ts @@ -26,7 +26,7 @@ export class DynamicThreadPool< */ public constructor ( min: number, - public readonly max: number, + protected readonly max: number, filePath: string, opts: PoolOptions = {} ) {