max,
median,
min,
+ once,
round
} from '../utils'
import { KillBehaviors } from '../worker/worker-options'
workerInfo.ready = message.ready as boolean
workerInfo.taskFunctionNames = message.taskFunctionNames
if (this.ready) {
- this.emitter?.emit(PoolEvents.ready, this.info)
+ const emitPoolReadyEventOnce = once(
+ () => this.emitter?.emit(PoolEvents.ready, this.info),
+ this
+ )
+ emitPoolReadyEventOnce()
}
}