Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
// Add worker set element sequentially to optimize memory at startup
this.workerOptions.workerStartDelay! > 0 &&
(await sleep(randomizeDelay(this.workerOptions.workerStartDelay!)));
+ this.emitter?.emit(WorkerSetEvents.started, this.info);
this.started = true;
}
});
await worker.terminate();
await waitWorkerExit;
+ this.emitter?.emit(WorkerSetEvents.stopped, this.info);
this.emitter?.emitDestroy();
this.started = false;
}
}
export enum WorkerSetEvents {
+ started = 'started',
+ stopped = 'stopped',
error = 'error',
elementStarted = 'elementStarted',
elementError = 'elementError',