Use generic for worker data type.
[e-mobility-charging-stations-simulator.git] / src / worker / Wrk.ts
1 import { WorkerData } from '../types/Worker';
2
3 export default abstract class Wrk {
4 protected workerScript: string;
5 public abstract size: number;
6 public abstract maxElementsPerWorker: number;
7
8 /**
9 * Create a new `Wrk`.
10 *
11 * @param {string} workerScript
12 */
13 constructor(workerScript: string) {
14 this.workerScript = workerScript;
15 }
16
17 public abstract start(): Promise<void>;
18 public abstract addElement(elementData: WorkerData): Promise<void>;
19 }