resolve()
})
})
+ worker.unref()
await worker.terminate()
await waitWorkerExit
}
this.emitter?.emit(WorkerSetEvents.stopped, this.info)
+ this.started = false
this.emitter?.emitDestroy()
this.emitter?.removeAllListeners()
- this.started = false
}
/** @inheritDoc */
) {
this.addWorkerSetElement()
}
+ worker.unref()
+ worker.terminate().catch(error => this.emitter?.emit(WorkerSetEvents.error, error))
})
worker.on('online', this.workerOptions.poolOptions?.onlineHandler ?? EMPTY_FUNCTION)
worker.on('exit', this.workerOptions.poolOptions?.exitHandler ?? EMPTY_FUNCTION)