import WorkerPool from './WorkerPool';
export default class Wrk {
- private static wrkInstances: Wrk[];
private workerScript: string;
private workerData: WorkerData;
private worker: Worker;
constructor(workerScript: string, workerData: WorkerData, maxWorkerElements = 1) {
this.workerData = workerData;
this.workerScript = workerScript;
- this.maxWorkerElements = maxWorkerElements;
- this.numWorkerElements = 0;
if (Configuration.useWorkerPool()) {
WorkerPool.maxConcurrentWorkers = Configuration.getWorkerPoolMaxSize();
+ } else {
+ this.maxWorkerElements = maxWorkerElements;
+ this.numWorkerElements = 0;
}
}