3 All notable changes to this project will be documented in this file.
5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
12 - Avoid worker node cross tasks stealing.
13 - Ensure only half the pool worker nodes can steal tasks.
15 ## [3.1.10] - 2023-12-23
19 - Avoid useless branching on pool type.
21 ## [3.1.9] - 2023-12-22
25 - Readd ThreadPoolOptions and ClusterPoolOptions TS type aliases to PoolOptions.
27 ## [3.1.8] - 2023-12-21
31 - Fix default worker weight computation.
32 - Fix possible null exception at pool destroying.
34 ## [3.1.7] - 2023-12-20
38 - Ensure worker choice strategies implementation wait for worker node readiness: [#1748](https://github.com/poolifier/poolifier/issues/1748).
40 ## [3.1.6] - 2023-12-18
44 - Fix pool destroying with tasks queuing enabled.
46 ## [3.1.5] - 2023-12-18
50 - Add queued tasks end timeout support to worker node termination.
52 ## [3.1.4] - 2023-12-18
56 - Make more robust the fix for possible null exception at handling task execution response.
58 ## [3.1.3] - 2023-12-17
62 - Fix possible null exception at handling task execution response.
64 ## [3.1.2] - 2023-12-17
68 - Wait for queued tasks to end at worker node termination.
70 ## [3.1.1] - 2023-12-16
74 - Fix pool options TS type definition.
76 ## [3.1.0] - 2023-12-16
80 - TypeScript breaking change: merge ThreadPoolOptions and ClusterPoolOptions types into PoolOptions type.
82 ## [3.0.14] - 2023-12-13
86 - Fix possible null exception with worker_threads pools.
88 ## [3.0.13] - 2023-12-12
92 - Ensure worker choice strategy wait for worker nodes readiness.
96 - Remove infinite retries support in worker choice strategy to avoid configuration leading to possible infinite recursion or loop.
98 ## [3.0.12] - 2023-12-12
102 - Add infinite retries support in worker choice strategy.
104 ## [3.0.11] - 2023-12-11
108 - Ensure pool asynchronous resource properly track tasks execution.
110 ## [3.0.10] - 2023-12-08
114 - Add a fastpath when tasks stealing or redistribution is impossible.
116 ## [3.0.9] - 2023-11-26
120 - Remove all pool events listener at pool destroying.
121 - Remove all worker node events listener at worker node destroying.
122 - Fix worker node event emitter listeners handling memory leak at pool options runtime change.
124 ## [3.0.8] - 2023-11-25
128 - Ensure continuous tasks stealing on idle start at worker node idling.
130 ## [3.0.7] - 2023-11-24
134 - Make continuous tasks stealing start at worker node idling.
136 ## [3.0.6] - 2023-11-24
140 - Ensure pool statuses are checked at initialization, `start()` or `destroy()`.
141 - Ensure pool `ready` event can be emitted after several `start()/destroy()` cycles.
143 ## [3.0.5] - 2023-10-27
147 - Ensure pool `ready` event can be emitted only once.
149 ## [3.0.4] - 2023-10-20
153 - Switch to Bencher for benchmarking: [https://bencher.dev/perf/poolifier](https://bencher.dev/perf/poolifier).
154 - Use builtin retry mechanism in worker choice strategies instead of custom one.
156 ## [3.0.3] - 2023-10-19
160 - Avoid null exception at sending message to worker.
161 - Avoid null exception at checking worker node readiness.
163 ## [3.0.2] - 2023-10-17
167 - Fix race condition at dynamic worker node task assignment and scheduled removal. See issue [#1468](https://github.com/poolifier/poolifier/issues/1468) and [#1496](https://github.com/poolifier/poolifier/issues/1496).
169 ## [3.0.1] - 2023-10-16
173 - Workaround possible race condition at work nodes array element removal and querying. See issue [#1468](https://github.com/poolifier/poolifier/issues/1468).
177 - Switch the worker node eventing code to `EventTarget` API.
179 ## [3.0.0] - 2023-10-08
183 - Remove Node.js 16.x.x (EOL) support.
185 ## [2.7.5] - 2023-10-03
189 - Use `EventEmitterAsyncResource` type from `@types/node` for pool event emitter. TypeScript users will need to update to latest `@types/node` version.
191 ## [2.7.4] - 2023-09-25
195 - Fix source maps (bundler issue).
197 ## [2.7.3] - 2023-09-24
201 - Convert pool event emitter to event emitter async resource.
203 ## [2.7.2] - 2023-09-23
207 - Add source maps to npm package to ease debugging.
211 - Continuous benchmarking versus other worker pools: [https://poolifier.github.io/benchmark](https://poolifier.github.io/benchmark).
213 ## [2.7.1] - 2023-09-20
217 - Ensure worker message listener used one time are removed after usage.
219 ## [2.7.0] - 2023-09-19
223 - Fix task stealing related tasks queue options handling at runtime.
227 - Rename `listTaskFunctions()` to `listTaskFunctionNames()` in pool and worker API.
231 - Add `hasTaskFunction()`, `addTaskFunction()`, `removeTaskFunction()`, `setDefaultTaskFunction()` methods to pool API: [PR #1148](https://github.com/poolifier/poolifier/pull/1148).
232 - Stricter worker constructor arguments validation.
234 ## [2.6.45] - 2023-09-17
238 - Disable publication on GitHub packages registry on release until authentication issue is fixed.
242 - Add `startWorkers` to pool options to whether start the minimum number of workers at pool initialization or not.
243 - Add `start()` method to pool API to start the minimum number of workers.
244 - Add `taskStealing` and `tasksStealingOnPressure` to tasks queue options to whether enable task stealing or not and whether enable tasks stealing under back pressure or not.
245 - Continuous internal benchmarking: [https://poolifier.github.io/benchmark-results/dev/bench](https://poolifier.github.io/benchmark-results/dev/bench).
247 ## [2.6.44] - 2023-09-08
251 - Use a dedicated PAT to publish on GitHub packages registry.
255 - Publish on GitHub packages registry on release.
259 - Switch from rome to biome: [PR #1128](https://github.com/poolifier/poolifier/pull/1128).
261 ## [2.6.43] - 2023-09-08
265 - Publish on GitHub packages registry on release.
269 - Switch from rome to biome: [PR #1128](https://github.com/poolifier/poolifier/pull/1128).
271 ## [2.6.42] - 2023-09-06
275 - Optimize hot code paths implementation: avoid unnecessary branching, add and use optimized helpers (min, max), use reduce() array helper, ...
277 ## [2.6.41] - 2023-09-03
281 - Optimize worker choice strategies implementation.
283 ## [2.6.40] - 2023-09-01
287 - Do not pre-choose in WRR worker choice strategy to avoid bias.
288 - Avoid array out of bound in worker choice strategies after worker node removal.
290 ## [2.6.39] - 2023-08-30
294 - Fix race condition in worker choice strategies at worker node info querying while not yet initialized.
296 ## [2.6.38] - 2023-08-30
300 - Bundle typescript types declaration into one file.
304 - Improve interleaved weighted round robin worker choice strategy implementation.
306 ## [2.6.37] - 2023-08-28
310 - Ensure unused worker usage statistics are deleted at runtime.
314 - Rename worker choice strategy options `choiceRetries` to `retries`.
315 - Avoid unnecessary branching in worker choice strategies.
317 ## [2.6.36] - 2023-08-27
321 - Fix pool `execute()` arguments check.
325 - Make continuous tasks stealing algorithm less aggressive.
326 - Fine tune tasks stealing algorithm under back pressure.
328 ## [2.6.35] - 2023-08-25
332 - Don't account worker usage statistics for tasks that have failed.
333 - Fix pool information runtime and wait time median computation.
337 - Update simple moving average implementation to use a circular buffer.
338 - Update simple moving median implementation to use a circular buffer.
339 - Account for stolen tasks in worker usage statistics and pool information.
343 - Continuous tasks stealing algorithm.
345 ## [2.6.34] - 2023-08-24
349 - Avoid cascading tasks stealing under back pressure.
353 - Add fastpath to queued tasks rescheduling.
355 ## [2.6.33] - 2023-08-24
359 - Fix queued tasks rescheduling.
363 - Rename tasks queue options `queueMaxSize` to `size`.
367 - Task stealing scheduling algorithm if tasks queueing is enabled.
369 ## [2.6.32] - 2023-08-23
373 - Ensure no task can be executed when the pool is destroyed.
377 - Add `queueMaxSize` option to tasks queue options.
378 - Add O(1) deque implementation implemented with doubly linked list and use it for tasks queueing.
379 - Add tasks stealing algorithm when a worker node queue is back pressured if tasks queueing is enabled.
381 ## [2.6.31] - 2023-08-20
385 - Fix worker choice strategy retries mechanism in some edge cases.
389 - Make orthogonal worker choice strategies tasks distribution and created dynamic worker usage.
390 - Remove the experimental status of the `LEAST_ELU` worker choice strategy.
392 ## [2.6.30] - 2023-08-19
396 - Ensure pool event `backPressure` is emitted.
397 - Ensure pool event `full` is emitted only once.
398 - Ensure worker node cannot be instantiated without proper arguments.
400 ## [2.6.29] - 2023-08-18
404 - Fix race condition between readiness and task functions worker message handling at startup.
405 - Fix duplicate task function worker usage statistics computation per task function.
406 - Update task function worker usage statistics if and only if there's at least two different task functions.
407 - Fix race condition at task function worker usage executing task computation leading to negative value.
411 - Add back pressure detection on the worker node queue. Event `backPressure` is emitted when all worker node queues are full (worker node queue size >= poolMaxSize^2).
412 - Use back pressure detection in worker choice strategies.
413 - Add worker choice strategies retries mechanism if no worker is eligible.
415 ## [2.6.28] - 2023-08-16
419 - Ensure pool workers are properly initialized.
423 - HTTP server pool examples: express-cluster, express-hybrid.
427 - Remove now useless branching in worker hot code path.
429 ## [2.6.27] - 2023-08-15
433 - Add `KillHandler` type definition to exported types.
437 - Add `destroy` event to pool API.
439 ## [2.6.26] - 2023-08-15
443 - Add kill handler to worker options allowing to execute custom code when worker is killed.
444 - Add `listTaskFunctions()` method to pool API.
445 - SMTP client pool example: nodemailer.
447 ## [2.6.25] - 2023-08-13
451 - HTTP server pool examples: fastify-cluster, fastify-hybrid.
452 - WebSocket server pool examples: ws-cluster, ws-hybrid.
454 ## [2.6.24] - 2023-08-12
458 - Add array of transferable objects to the `execute()` method arguments.
459 - WebSocket server pool examples: ws-worker_threads.
461 ## [2.6.23] - 2023-08-11
465 - Fix pool busyness semantic when tasks queueing is enabled: the pool is busy when the number of executing tasks on each worker has reached the maximum tasks concurrency per worker.
469 - HTTP client pool examples: fetch, node-fetch and axios with multiple task functions.
470 - HTTP server pool examples: express-worker_threads, fastify-worker_threads.
472 ## [2.6.22] - 2023-08-10
476 - Add missing `types` field to package.json `exports`.
480 - Structure markdown documentation (PR #811).
482 ## [2.6.21] - 2023-08-03
486 - Improve code documentation.
487 - Code refactoring and cleanup for better maintainability and readability.
489 ## [2.6.20] - 2023-07-21
493 - Fix queued tasks redistribution on error task execution starvation.
494 - Ensure tasks queueing per worker condition is untangled from the pool busyness semantic.
498 - Drastically reduce lookups by worker in the worker nodes.
500 ## [2.6.19] - 2023-07-20
504 - Dedicated internal communication channel for worker_threads pools.
506 ## [2.6.18] - 2023-07-19
510 - Code refactoring and cleanup for better maintainability and readability. Bundle size is a bit smaller.
512 ## [2.6.17] - 2023-07-16
516 - Add `listTaskFunctions()` method to worker API.
518 ## [2.6.16] - 2023-07-12
522 - Fix pool startup detection.
523 - Fix worker task functions handling.
525 ## [2.6.15] - 2023-07-11
529 - Take into account worker node readiness in worker choice strategies.
531 ## [2.6.14] - 2023-07-10
535 - Fix task function statistics tracking.
537 ## [2.6.13] - 2023-07-10
541 - Add per task function statistics tracking.
542 - Add public methods to manipulate the worker task functions at runtime.
544 ## [2.6.12] - 2023-07-09
548 - Workaround import issue with `node:os` module in node 16.x.x.
550 ## [2.6.11] - 2023-07-09
554 - Fix pool readiness semantic.
556 ## [2.6.10] - 2023-07-08
560 - Ensure workers are not recreated on error at pool startup.
564 - Add `ready` and `strategy` fields to pool information.
565 - Add pool event `ready` to notify when the number of workers created in the pool has reached the maximum size expected and are ready.
566 - Add dynamic pool sizing checks.
568 ## [2.6.9] - 2023-07-07
572 - Recreate the right worker type on uncaught exception.
576 - Add minimum and maximum to internal measurement statistics.
577 - Add `runTime` and `waitTime` to pool information.
578 - Check worker inactive time only on dynamic worker.
580 ## [2.6.8] - 2023-07-03
584 - Brown paper bag release to fix version handling in pool information.
586 ## [2.6.7] - 2023-07-03
590 - Ensure worker queued tasks at error are reassigned to other pool workers.
594 - Add pool `utilization` ratio to pool information.
595 - Add `version` to pool information.
596 - Add worker information to worker nodes.
598 ## [2.6.6] - 2023-07-01
602 - Add safe helper `availableParallelism()` to help sizing the pool.
606 - Ensure message handler is only registered in worker.
608 ## [2.6.5] - 2023-06-27
612 - Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
616 - Artificial version bump to 2.6.5 to workaround publication issue.
617 - Ensure cluster pool `destroy()` gracefully shutdowns worker's server.
618 - Ensure pool event is emitted before task error promise rejection.
619 - Fix queued tasks count computation.
623 - Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
625 ## [2.6.4] - 2023-06-27
629 - Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
633 - Ensure cluster pool `destroy()` gracefully shutdowns worker's server.
634 - Ensure pool event is emitted before task error promise rejection.
635 - Fix queued tasks count computation.
639 - Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
641 ## [2.6.3] - 2023-06-19
645 - Ensure no tasks are queued when trying to soft kill a dynamic worker.
646 - Update strategies internals after statistics computation.
650 - Optimize O(1) queue implementation.
652 ## [2.6.2] - 2023-06-12
656 - Fix new worker use after creation in dynamic pool given the current worker choice strategy.
658 ## [2.6.1] - 2023-06-10
662 - Add worker choice strategy documentation: [README.md](./docs/worker-choice-strategies.md).
666 - Fix average statistics computation: ensure failed tasks are not accounted.
668 ## [2.6.0] - 2023-06-09
672 - Add `LEAST_ELU` worker choice strategy (experimental).
673 - Add tasks ELU instead of runtime support to `FAIR_SHARE` worker choice strategy.
677 - Refactor pool worker node usage internals.
678 - Breaking change: refactor worker choice strategy statistics requirements: the syntax of the worker choice strategy options has changed.
679 - Breaking change: pool information `info` property object fields have been renamed.
683 - Fix wait time accounting.
684 - Ensure worker choice strategy `LEAST_BUSY` accounts also tasks wait time.
685 - Ensure worker choice strategy `LEAST_USED` accounts also queued tasks.
687 ## [2.5.4] - 2023-06-07
691 - Add Event Loop Utilization (ELU) statistics to worker tasks usage.
695 - Compute statistics at the worker level only if needed.
696 - Add `worker_threads` options to thread pool options.
700 - Make the `LEAST_BUSY` strategy only relies on task runtime.
702 ## [2.5.3] - 2023-06-04
706 - Refine pool information content.
707 - Limit pool internals public exposure.
709 ## [2.5.2] - 2023-06-02
713 - Add `taskError` pool event for task execution error.
714 - Add pool information `info` property to pool.
715 - Emit pool information on `busy` and `full` pool events.
717 ## [2.5.1] - 2023-06-01
721 - Add pool option `restartWorkerOnError` to restart worker on uncaught error. Default to `true`.
722 - Add `error` pool event for uncaught worker error.
724 ## [2.5.0] - 2023-05-31
728 - Switch pool event emitter to `EventEmitterAsyncResource`.
729 - Add tasks wait time accounting in per worker tasks usage.
730 - Add interleaved weighted round robin `INTERLEAVED_WEIGHTED_ROUND_ROBIN` worker choice strategy (experimental).
734 - Renamed worker choice strategy `LESS_BUSY` to `LEAST_BUSY` and `LESS_USED` to `LEAST_USED`.
736 ## [2.4.14] - 2023-05-09
740 - Ensure no undefined task runtime can land in the tasks history.
741 - Fix median computation implementation once again.
745 - Unit tests for median and queue implementations.
747 ## [2.4.13] - 2023-05-08
751 - Fix worker choice strategy options validation.
752 - Fix fair share worker choice strategy internals update: ensure virtual task end timestamp is computed at task submission.
754 ## [2.4.12] - 2023-05-06
758 - Support multiple task functions per worker.
759 - Add custom worker weights support to worker choice strategies options.
763 - Use O(1) queue implementation for tasks queueing.
767 - Fix median computation implementation.
768 - Fix fair share worker choice strategy internals update.
770 ## [2.4.11] - 2023-04-23
774 - Optimize free worker finding in worker choice strategies.
776 ## [2.4.10] - 2023-04-15
780 - Fix typescript type definition for task function: ensure the input data is optional.
781 - Fix typescript type definition for pool execute(): ensure the input data is optional.
783 ## [2.4.9] - 2023-04-15
787 - Add tasks queue enablement runtime setter to pool.
788 - Add tasks queue options runtime setter to pool.
789 - Add worker choice strategy options runtime setter to pool.
793 - Remove the tasks queuing experimental status.
797 - Fix task function type definition and validation.
798 - Fix worker choice strategy options handling.
800 ## [2.4.8] - 2023-04-12
804 - Fix message between main worker and worker type definition for tasks.
805 - Fix code documentation.
807 ## [2.4.7] - 2023-04-11
811 - Add worker tasks queue options to pool options.
815 - Fix missing documentation.
817 ## [2.4.6] - 2023-04-10
821 - Ensure one task at a time is executed per worker with tasks queueing enabled.
822 - Properly count worker executing tasks with tasks queueing enabled.
824 ## [2.4.5] - 2023-04-09
828 - Use monotonic high resolution timer for worker tasks runtime.
829 - Add worker tasks median runtime to statistics.
830 - Add worker tasks queue (experimental).
832 ## [2.4.4] - 2023-04-07
836 - Add `PoolEvents` enumeration and `PoolEvent` type.
840 - Destroy worker only on alive check.
842 ## [2.4.3] - 2023-04-07
846 - Fix typedoc generation with inheritance.
848 ## [2.4.2] - 2023-04-06
852 - Add `full` event to dynamic pool.
853 - Keep worker choice strategy in memory for conditional reuse.
857 - Fix possible negative worker key at worker removal in worker choice strategies.
859 ## [2.4.1] - 2023-04-05
863 - Optimize worker choice strategy for dynamic pool.
867 - Ensure dynamic pool does not alter worker choice strategy expected behavior.
869 ## [2.4.0] - 2023-04-04
873 - Add `LESS_BUSY` worker choice strategy.
877 - Optimize worker storage in pool.
878 - Optimize worker alive status check.
879 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
880 - Optimize `LESS_USED` worker choice strategy.
881 - Update benchmark versus external threads pools.
882 - Optimize tasks usage statistics requirements for worker choice strategy.
886 - Ensure trimmable characters are checked at pool initialization.
887 - Fix message id integer overflow.
888 - Fix pool worker removal in worker choice strategy internals.
889 - Fix package publication with pnpm.
891 ## [2.4.0-3] - 2023-04-04
895 - Add `LESS_BUSY` worker choice strategy.
899 - Optimize worker storage in pool.
900 - Optimize worker alive status check.
901 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
902 - Optimize `LESS_USED` worker choice strategy.
903 - Update benchmark versus external threads pools.
907 - Ensure trimmable characters are checked at pool initialization.
908 - Fix message id integer overflow.
909 - Fix pool worker removal in worker choice strategy internals.
910 - Fix package publication with pnpm.
912 ## [2.4.0-2] - 2023-04-03
916 - Add `LESS_BUSY` worker choice strategy.
920 - Optimize worker storage in pool.
921 - Optimize worker alive status check.
922 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
923 - Optimize `LESS_USED` worker choice strategy.
927 - Ensure trimmable characters are checked at pool initialization.
928 - Fix message id integer overflow.
929 - Fix pool worker removal in worker choice strategy internals.
930 - Fix package publication with pnpm.
932 ## [2.4.0-1] - 2023-04-03
936 - Add `LESS_BUSY` worker choice strategy.
940 - Optimize worker storage in pool.
941 - Optimize worker alive status check.
942 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
943 - Optimize `LESS_USED` worker choice strategy.
947 - Ensure trimmable characters are checked at pool initialization.
948 - Fix message id integer overflow.
949 - Fix pool worker removal in worker choice strategy internals.
951 ## [2.4.0-0] - 2023-04-03
955 - Add `LESS_BUSY` worker choice strategy.
959 - Optimize worker storage in pool.
960 - Optimize worker alive status check.
961 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
962 - Optimize `LESS_USED` worker choice strategy.
966 - Ensure trimmable characters are checked at pool initialization.
967 - Fix message id integer overflow.
968 - Fix pool worker removal in worker choice strategy internals.
970 ## [2.3.10] - 2023-03-18
974 - Fix package.json `exports` syntax for ESM and CommonJS.
978 - Permit SemVer pre-release publication.
980 ## [2.3.10-2] - 2023-03-18
984 - Fix package.json `exports` syntax for ESM and CommonJS.
986 ## [2.3.10-1] - 2023-03-18
990 - Permit SemVer pre-release publication.
992 ## [2.3.10-0] - 2023-03-18
996 - Fix package.json `exports` syntax for ESM and CommonJS.
998 ## [2.3.9] - 2023-03-18
1002 - Introduce ESM module support along with CommonJS one.
1006 - Fix brown paper bag bug referencing the same object literal.
1008 ## [2.3.8] - 2023-03-18
1012 - Switch internal benchmarking code to benny.
1013 - Switch to TypeScript 5.x.x.
1014 - Switch rollup bundler plugins to core ones.
1015 - Switch to TSDoc syntax.
1016 - Enforce conventional commits.
1020 - Fix random integer generator.
1021 - Fix worker choice strategy pool type identification at initialization.
1023 ## [2.3.7] - 2022-10-23
1027 - Switch to open collective FOSS project funding platform.
1028 - Switch to ts-standard linter configuration on TypeScript code.
1032 - Fixed missing async on pool execute method.
1033 - Fixed typing in TypeScript example.
1034 - Fixed types in unit tests.
1036 ## [2.3.6] - 2022-10-22
1040 - Cleanup pool attributes and methods.
1041 - Refine error types thrown.
1045 - Fix continuous integration build on windows.
1046 - Fix code coverage reporting by using c8 instead of nyc.
1048 ## [2.3.5] - 2022-10-21
1052 - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
1053 - Optimize tasks usage lookup implementation.
1057 - Fix missed pool event emitter type export.
1058 - Fix typedoc documentation generation.
1060 ## [2.3.4] - 2022-10-17
1064 - Fully automate release process with release-it.
1068 - Optimize fair share task scheduling algorithm implementation.
1069 - Update benchmark versus external pools results with latest version.
1071 ## [2.3.3] - 2022-10-15
1075 - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
1077 ## [2.3.2] - 2022-10-14
1081 - Optimize fair share worker selection strategy implementation.
1085 - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
1087 ## [2.3.1] - 2022-10-13
1091 - Pool worker choice strategies:
1092 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
1093 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
1095 ## [2.2.2] - 2022-10-09
1099 - Fixed `README.md` file.
1101 ## [2.2.1] - 2022-10-08
1105 - Dynamic worker choice strategy change at runtime.
1107 ## [2.2.0] - 2022-01-05
1109 ### Breaking Changes
1111 - Support only Node.js version 16.x.x for cluster pool: upstream cluster API have changed on that version.
1113 ## [2.1.0] - 2021-08-29
1117 - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
1119 ### Breaking Changes
1121 - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
1122 - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
1123 - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
1124 - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
1126 ## [2.0.2] - 2021-05-12
1130 - Fix `busy` event emission on fixed pool type
1132 ## [2.0.1] - 2021-03-16
1136 - Check if pool options are properly set.
1137 - `busy` event is emitted on all pool types.
1139 ## [2.0.0] - 2021-03-01
1143 - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
1145 ### Breaking Changes
1147 - `FullPool` event is now renamed to `busy`.
1148 - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
1149 _Find more details on our JSDoc._
1151 - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
1153 - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
1155 ### Pool options types declaration merge
1157 `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
1159 #### New `export` strategy
1163 const DynamicThreadPool = require('poolifier/lib/dynamic')
1165 const { DynamicThreadPool } = require('poolifier/lib/dynamic')
1168 But you should always prefer just using
1171 const { DynamicThreadPool } = require('poolifier')
1174 #### New type definitions for input data and response
1176 For cluster worker and worker-thread pools, you can now only send and receive structured-cloneable data.
1177 _This is not a limitation by poolifier but Node.js._
1179 #### Public property replacements
1181 `numWorkers` property is now `numberOfWorkers`
1183 #### Internal (protected) properties and methods renaming
1185 These properties are not intended for end users
1187 - `id` => `nextMessageId`
1189 These methods are not intended for end users
1191 - `_chooseWorker` => `chooseWorker`
1192 - `_newWorker` => `createWorker`
1193 - `_execute` => `internalExecute`
1194 - `_chooseWorker` => `chooseWorker`
1195 - `_checkAlive` => `checkAlive`
1197 - `_runAsync` => `runAsync`
1199 ## [1.1.0] - 2020-05-21
1203 - ThreadWorker support async functions as option
1204 - Various external library patches
1206 ## [1.0.0] - 2020-01-24
1210 - FixedThreadPool implementation
1211 - DynamicThreadPool implementation
1212 - WorkerThread implementation to improve developer experience