Check that a pool have a minimum number of workers (#213)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 22 Feb 2021 18:02:10 +0000 (19:02 +0100)
committerGitHub <noreply@github.com>
Mon, 22 Feb 2021 18:02:10 +0000 (19:02 +0100)
commit8d3782faec08afef3370aaaadd06de2c1cb270fd
tree9ef864d407f16a9597bdd1e2446d15bf4abb2fe9
parent3be5ac00a9f736bda56c5ef053c4cd3b17f851f6
Check that a pool have a minimum number of workers (#213)

* Check that a pool have at least one worker,

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Specify return type on checkNumberOfWorkers

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Fix dynamic pool handling and add unit tests.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Add more sanity checks to numberOfWorkers.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Increase branches coverage.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Renable skipped test on cluster worker.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Remove wrong comment.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Try to increase coverage by alternating fixed pool type.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Address review comments.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Sync package-lock.json

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Remove debug log.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Fix tests (#218)

* Fix the unit test for the number of workers.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
* Cleanups.

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
Co-authored-by: Shinigami <chrissi92@hotmail.de>
13 files changed:
benchmarks/README.md
benchmarks/versus-external-pools/functions/function-to-bench.js
package-lock.json
src/pools/abstract-pool.ts
tests/pools/abstract/abstract-pool.test.js
tests/pools/cluster/dynamic.test.js
tests/pools/cluster/fixed.test.js
tests/pools/selection-strategies.test.js
tests/pools/thread/dynamic.test.js
tests/pools/thread/fixed.test.js
tests/worker/abstract-worker.test.js
tests/worker/cluster-worker.test.js
tests/worker/thread-worker.test.js