// 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;
}