public readonly filePath: string,
public readonly opts: PoolOptions<Worker>
) {
- if (!this.isMain()) {
+ if (this.isMain() === false) {
throw new Error('Cannot start a pool from a worker!')
}
this.checkNumberOfWorkers(this.numberOfWorkers)
this.createAndSetupWorker()
}
- if (this.opts.enableEvents) {
+ if (this.opts.enableEvents === true) {
this.emitter = new PoolEmitter()
}
this.workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
}
private checkAndEmitBusy (): void {
- if (this.opts.enableEvents && this.busy) {
+ if (this.opts.enableEvents === true && this.busy === true) {
this.emitter?.emit('busy')
}
}