Spell fixlet in ATG log message
[e-mobility-charging-stations-simulator.git] / src / worker / WorkerAbstract.ts
index 6a8a0a0ff07dc9003816ea6f76ef9e356d22a1de..a18a085e5e0a37a58b3b31127976005f3fe4f9be 100644 (file)
@@ -1,17 +1,21 @@
+import Constants from '../utils/Constants';
 import { WorkerData } from '../types/Worker';
 
 export default abstract class WorkerAbstract {
-  protected workerScript: string;
+  protected readonly workerScript: string;
+  protected readonly workerStartDelay: number;
   public abstract size: number;
-  public abstract maxElementsPerWorker: number;
+  public abstract maxElementsPerWorker: number | null;
 
   /**
-   * Create a new `Worker` implementation.
+   * `WorkerAbstract` constructor.
    *
-   * @param {string} workerScript
+   * @param workerScript
+   * @param workerStartDelay
    */
-  constructor(workerScript: string) {
+  constructor(workerScript: string, workerStartDelay: number = Constants.WORKER_START_DELAY) {
     this.workerScript = workerScript;
+    this.workerStartDelay = workerStartDelay;
   }
 
   public abstract start(): Promise<void>;