node-worker-nodes
node-worker-nodes copied to clipboard
minWorkers/maxWorkers ambiguity
The minWorkers
option is only respected when initially reporting pool readiness, but should also be treated as a number of workers that the pool needs to keep running all the time, i.e.:
- on any accidental worker termination, pool should boot a new worker immediately (if
minWorkers
number is greater than the current number of healthy workers) - a planned worker exit (for example as a result of
WorkerEndurance
value exceedance) should result in a spawn of a new worker before starting the process of termination the exhausted one (maybe even at cost of some extra calls above declared endurance).