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.
import { WorkerUtils } from './WorkerUtils';
export default class WorkerDynamicPool<T> extends WorkerAbstract {
- private pool: DynamicThreadPool<WorkerData>;
+ private readonly pool: DynamicThreadPool<WorkerData>;
/**
* Create a new `WorkerDynamicPool`.
export default class WorkerSet<T> extends WorkerAbstract {
public readonly maxElementsPerWorker: number;
private readonly messageHandler: (message: unknown) => void | Promise<void>;
- private workerSet: Set<WorkerSetElement>;
+ private readonly workerSet: Set<WorkerSetElement>;
/**
* Create a new `WorkerSet`.
import { WorkerUtils } from './WorkerUtils';
export default class WorkerStaticPool<T> extends WorkerAbstract {
- private pool: FixedThreadPool<WorkerData>;
+ private readonly pool: FixedThreadPool<WorkerData>;
/**
* Create a new `WorkerStaticPool`.