From: Jérôme Benoit Date: Sun, 3 Oct 2021 02:45:27 +0000 (+0200) Subject: Mark some attributes readonly X-Git-Tag: v1.1.24~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f2bf9948496c724976a2e05d2f20cb17700373ec;p=e-mobility-charging-stations-simulator.git Mark some attributes readonly Signed-off-by: Jérôme Benoit --- diff --git a/src/worker/WorkerAbstract.ts b/src/worker/WorkerAbstract.ts index a18a085e..fa28597c 100644 --- a/src/worker/WorkerAbstract.ts +++ b/src/worker/WorkerAbstract.ts @@ -4,8 +4,8 @@ import { WorkerData } from '../types/Worker'; export default abstract class WorkerAbstract { protected readonly workerScript: string; protected readonly workerStartDelay: number; - public abstract size: number; - public abstract maxElementsPerWorker: number | null; + public abstract readonly size: number; + public abstract readonly maxElementsPerWorker: number | null; /** * `WorkerAbstract` constructor. diff --git a/src/worker/WorkerDynamicPool.ts b/src/worker/WorkerDynamicPool.ts index f081b3c3..e2dd3b1e 100644 --- a/src/worker/WorkerDynamicPool.ts +++ b/src/worker/WorkerDynamicPool.ts @@ -7,7 +7,7 @@ import { WorkerData } from '../types/Worker'; import { WorkerUtils } from './WorkerUtils'; export default class WorkerDynamicPool extends WorkerAbstract { - private pool: DynamicThreadPool; + private readonly pool: DynamicThreadPool; /** * Create a new `WorkerDynamicPool`. diff --git a/src/worker/WorkerSet.ts b/src/worker/WorkerSet.ts index f25fd03c..d179608d 100644 --- a/src/worker/WorkerSet.ts +++ b/src/worker/WorkerSet.ts @@ -10,7 +10,7 @@ import { WorkerUtils } from './WorkerUtils'; export default class WorkerSet extends WorkerAbstract { public readonly maxElementsPerWorker: number; private readonly messageHandler: (message: unknown) => void | Promise; - private workerSet: Set; + private readonly workerSet: Set; /** * Create a new `WorkerSet`. diff --git a/src/worker/WorkerStaticPool.ts b/src/worker/WorkerStaticPool.ts index cbc62fb6..d5d6390c 100644 --- a/src/worker/WorkerStaticPool.ts +++ b/src/worker/WorkerStaticPool.ts @@ -7,7 +7,7 @@ import { WorkerData } from '../types/Worker'; import { WorkerUtils } from './WorkerUtils'; export default class WorkerStaticPool extends WorkerAbstract { - private pool: FixedThreadPool; + private readonly pool: FixedThreadPool; /** * Create a new `WorkerStaticPool`.