Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/fastify-worker_thr...
[poolifier.git] / CHANGELOG.md
1 # Changelog
2
3 All notable changes to this project will be documented in this file.
4
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).
7
8 ## [Unreleased]
9
10 ## [2.7.0] - 2023-09-19
11
12 ### Fixed
13
14 - Fix task stealing related tasks queue options handling at runtime.
15
16 ### Changed
17
18 - Rename `listTaskFunctions()` to `listTaskFunctionNames()` in pool and worker API.
19
20 ### Added
21
22 - Add `hasTaskFunction()`, `addTaskFunction()`, `removeTaskFunction()`, `setDefaultTaskFunction()` methods to pool API: [PR #1148](https://github.com/poolifier/poolifier/pull/1148).
23 - Stricter worker constructor arguments validation.
24
25 ## [2.6.45] - 2023-09-17
26
27 ### Changed
28
29 - Disable publication on GitHub packages registry on release until authentication issue is fixed.
30
31 ### Added
32
33 - Add `startWorkers` to pool options to whether start the minimum number of workers at pool creation or not.
34 - Add `start()` method to pool API to start the minimum number of workers.
35 - Add `taskStealing` and `tasksStealingOnPressure` to tasks queue options to whether enable task stealing or not and whether enable tasks stealing on back pressure or not.
36 - Continuous internal benchmarking: https://poolifier.github.io/benchmark-results/dev/bench.
37
38 ## [2.6.44] - 2023-09-08
39
40 ### Fixed
41
42 - Use a dedicated PAT to publish on GitHub packages registry.
43
44 ### Added
45
46 - Publish on GitHub packages registry on release.
47
48 ### Changed
49
50 - Switch from rome to biome: [PR #1128](https://github.com/poolifier/poolifier/pull/1128).
51
52 ## [2.6.43] - 2023-09-08
53
54 ### Added
55
56 - Publish on GitHub packages registry on release.
57
58 ### Changed
59
60 - Switch from rome to biome: [PR #1128](https://github.com/poolifier/poolifier/pull/1128).
61
62 ## [2.6.42] - 2023-09-06
63
64 ### Changed
65
66 - Optimize hot code paths implementation: avoid unnecessary branching, add and use optimized helpers (min, max), use reduce() array helper, ...
67
68 ## [2.6.41] - 2023-09-03
69
70 ### Changed
71
72 - Optimize worker choice strategies implementation.
73
74 ## [2.6.40] - 2023-09-01
75
76 ### Fixed
77
78 - Do not pre-choose in WRR worker choice strategy to avoid bias.
79 - Avoid array out of bound in worker choice strategies after worker node removal.
80
81 ## [2.6.39] - 2023-08-30
82
83 ### Fixed
84
85 - Fix race condition in worker choice strategies at worker node info querying while not yet initialized.
86
87 ## [2.6.38] - 2023-08-30
88
89 ### Added
90
91 - Bundle typescript types declaration into one file.
92
93 ### Changed
94
95 - Improve interleaved weighted round robin worker choice strategy implementation.
96
97 ## [2.6.37] - 2023-08-28
98
99 ### Fixed
100
101 - Ensure unused worker usage statistics are deleted at runtime.
102
103 ### Changed
104
105 - Rename worker choice strategy options `choiceRetries` to `retries`.
106 - Avoid unnecessary branching in worker choice strategies.
107
108 ## [2.6.36] - 2023-08-27
109
110 ### Fixed
111
112 - Fix pool `execute()` arguments check.
113
114 ### Changed
115
116 - Make continuous tasks stealing algorithm less aggressive.
117 - Fine tune tasks stealing algorithm under back pressure.
118
119 ## [2.6.35] - 2023-08-25
120
121 ### Fixed
122
123 - Don't account worker usage statistics for tasks that have failed.
124 - Fix pool information runtime and wait time median computation.
125
126 ### Changed
127
128 - Update simple moving average implementation to use a circular buffer.
129 - Update simple moving median implementation to use a circular buffer.
130 - Account for stolen tasks in worker usage statistics and pool information.
131
132 ### Added
133
134 - Continuous tasks stealing algorithm.
135
136 ## [2.6.34] - 2023-08-24
137
138 ### Fixes
139
140 - Avoid cascading tasks stealing under back pressure.
141
142 ### Changed
143
144 - Add fastpath to queued tasks rescheduling.
145
146 ## [2.6.33] - 2023-08-24
147
148 ### Fixed
149
150 - Fix queued tasks rescheduling.
151
152 ### Changed
153
154 - Rename tasks queue options `queueMaxSize` to `size`.
155
156 ### Added
157
158 - Task stealing scheduling algorithm if tasks queueing is enabled.
159
160 ## [2.6.32] - 2023-08-23
161
162 ### Fixed
163
164 - Ensure no task can be executed when the pool is destroyed.
165
166 ### Added
167
168 - Add `queueMaxSize` option to tasks queue options.
169 - Add O(1) deque implementation implemented with doubly linked list and use it for tasks queueing.
170 - Add tasks stealing algorithm when a worker node queue is back pressured if tasks queueing is enabled.
171
172 ## [2.6.31] - 2023-08-20
173
174 ### Fixed
175
176 - Fix worker choice strategy retries mechanism in some edge cases.
177
178 ### Changed
179
180 - Make orthogonal worker choice strategies tasks distribution and created dynamic worker usage.
181 - Remove the experimental status of the `LEAST_ELU` worker choice strategy.
182
183 ## [2.6.30] - 2023-08-19
184
185 ### Fixed
186
187 - Ensure pool event `backPressure` is emitted.
188 - Ensure pool event `full` is emitted only once.
189 - Ensure worker node cannot be instantiated without proper arguments.
190
191 ## [2.6.29] - 2023-08-18
192
193 ### Fixed
194
195 - Fix race condition between ready and task functions worker message handling at startup.
196 - Fix duplicate task function worker usage statistics computation per task function.
197 - Update task function worker usage statistics if and only if there's at least two different task functions.
198 - Fix race condition at task function worker usage executing task computation leading to negative value.
199
200 ### Added
201
202 - 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).
203 - Use back pressure detection in worker choice strategies.
204 - Add worker choice strategies retries mechanism if no worker is eligible.
205
206 ## [2.6.28] - 2023-08-16
207
208 ### Fixed
209
210 - Ensure pool workers are properly initialized.
211
212 ### Added
213
214 - HTTP server pool examples: express-cluster, express-hybrid.
215
216 ### Changed
217
218 - Remove now useless branching in worker hot code path.
219
220 ## [2.6.27] - 2023-08-15
221
222 ### Fixed
223
224 - Add `KillHandler` type definition to exported types.
225
226 ### Added
227
228 - Add `destroy` event to pool API.
229
230 ## [2.6.26] - 2023-08-15
231
232 ### Added
233
234 - Add kill handler to worker options allowing to execute custom code when worker is killed.
235 - Add `listTaskFunctions()` method to pool API.
236 - SMTP client pool example: nodemailer.
237
238 ## [2.6.25] - 2023-08-13
239
240 ### Added
241
242 - HTTP server pool examples: fastify-cluster, fastify-hybrid.
243 - WebSocket server pool examples: ws-cluster, ws-hybrid.
244
245 ## [2.6.24] - 2023-08-12
246
247 ### Added
248
249 - Add array of transferable objects to the `execute()` method arguments.
250 - WebSocket server pool examples: ws-worker_threads.
251
252 ## [2.6.23] - 2023-08-11
253
254 ### Fixed
255
256 - 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.
257
258 ### Added
259
260 - HTTP client pool examples: fetch, node-fetch and axios with multiple task functions.
261 - HTTP server pool examples: express-worker_threads, fastify-worker_threads.
262
263 ## [2.6.22] - 2023-08-10
264
265 ### Fixed
266
267 - Add missing `types` field to package.json `exports`.
268
269 ### Changed
270
271 - Structure markdown documentation (PR #811).
272
273 ## [2.6.21] - 2023-08-03
274
275 ### Changed
276
277 - Improve code documentation.
278 - Code refactoring and cleanup for better maintainability and readability.
279
280 ## [2.6.20] - 2023-07-21
281
282 ### Fixed
283
284 - Fix queued tasks redistribution on error task execution starvation.
285 - Ensure tasks queueing per worker condition is untangled from the pool busyness semantic.
286
287 ### Changed
288
289 - Drastically reduce lookups by worker in the worker nodes.
290
291 ## [2.6.19] - 2023-07-20
292
293 ### Added
294
295 - Dedicated internal communication channel for worker_threads pools.
296
297 ## [2.6.18] - 2023-07-19
298
299 ### Changed
300
301 - Code refactoring and cleanup for better maintainability and readability. Bundle size is a bit smaller.
302
303 ## [2.6.17] - 2023-07-16
304
305 ### Added
306
307 - Add `listTaskFunctions()` method to worker API.
308
309 ## [2.6.16] - 2023-07-12
310
311 ### Fixed
312
313 - Fix pool startup detection.
314 - Fix worker task functions handling.
315
316 ## [2.6.15] - 2023-07-11
317
318 ### Added
319
320 - Take into account worker node readiness in worker choice strategies.
321
322 ## [2.6.14] - 2023-07-10
323
324 ### Fixed
325
326 - Fix task function statistics tracking.
327
328 ## [2.6.13] - 2023-07-10
329
330 ### Added
331
332 - Add per task function statistics tracking.
333 - Add public methods to manipulate the worker task functions at runtime.
334
335 ## [2.6.12] - 2023-07-09
336
337 ### Fixed
338
339 - Workaround import issue with `node:os` module in node 16.x.x.
340
341 ## [2.6.11] - 2023-07-09
342
343 ### Fixed
344
345 - Fix pool readiness semantic.
346
347 ## [2.6.10] - 2023-07-08
348
349 ### Fixed
350
351 - Ensure workers are not recreated on error at pool startup.
352
353 ### Added
354
355 - Add `ready` and `strategy` fields to pool information.
356 - Add pool event `ready` to notify when the number of workers created in the pool has reached the maximum size expected and are ready.
357 - Add dynamic pool sizing checks.
358
359 ## [2.6.9] - 2023-07-07
360
361 ### Fixed
362
363 - Recreate the right worker type on uncaught exception.
364
365 ### Added
366
367 - Add minimum and maximum to internal measurement statistics.
368 - Add `runTime` and `waitTime` to pool information.
369 - Check worker inactive time only on dynamic worker.
370
371 ## [2.6.8] - 2023-07-03
372
373 ### Fixed
374
375 - Brown paper bag release to fix version handling in pool information.
376
377 ## [2.6.7] - 2023-07-03
378
379 ### Fixed
380
381 - Ensure worker queued tasks at error are reassigned to other pool workers.
382
383 ### Added
384
385 - Add pool `utilization` ratio to pool information.
386 - Add `version` to pool information.
387 - Add worker information to worker nodes.
388
389 ## [2.6.6] - 2023-07-01
390
391 ### Added
392
393 - Add safe helper `availableParallelism()` to help sizing the pool.
394
395 ### Fixed
396
397 - Ensure message handler is only registered in worker.
398
399 ## [2.6.5] - 2023-06-27
400
401 ### Known issues
402
403 - Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
404
405 ### Fixed
406
407 - Artificial version bump to 2.6.5 to workaround publication issue.
408 - Ensure cluster pool `destroy()` gracefully shutdowns worker's server.
409 - Ensure pool event is emitted before task error promise rejection.
410 - Fix queued tasks count computation.
411
412 ### Removed
413
414 - Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
415
416 ## [2.6.4] - 2023-06-27
417
418 ### Known issues
419
420 - Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
421
422 ### Fixed
423
424 - Ensure cluster pool `destroy()` gracefully shutdowns worker's server.
425 - Ensure pool event is emitted before task error promise rejection.
426 - Fix queued tasks count computation.
427
428 ### Removed
429
430 - Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
431
432 ## [2.6.3] - 2023-06-19
433
434 ### Fixed
435
436 - Ensure no tasks are queued when trying to soft kill a dynamic worker.
437 - Update strategies internals after statistics computation.
438
439 ### Changed
440
441 - Optimize O(1) queue implementation.
442
443 ## [2.6.2] - 2023-06-12
444
445 ### Fixed
446
447 - Fix new worker use after creation in dynamic pool given the current worker choice strategy.
448
449 ## [2.6.1] - 2023-06-10
450
451 ### Added
452
453 - Add worker choice strategy documentation: [README.md](./docs/worker-choice-strategies.md).
454
455 ### Fixed
456
457 - Fix average statistics computation: ensure failed tasks are not accounted.
458
459 ## [2.6.0] - 2023-06-09
460
461 ### Added
462
463 - Add `LEAST_ELU` worker choice strategy (experimental).
464 - Add tasks ELU instead of runtime support to `FAIR_SHARE` worker choice strategy.
465
466 ### Changed
467
468 - Refactor pool worker node usage internals.
469 - Breaking change: refactor worker choice strategy statistics requirements: the syntax of the worker choice strategy options has changed.
470 - Breaking change: pool information `info` property object fields have been renamed.
471
472 ### Fixed
473
474 - Fix wait time accounting.
475 - Ensure worker choice strategy `LEAST_BUSY` accounts also tasks wait time.
476 - Ensure worker choice strategy `LEAST_USED` accounts also queued tasks.
477
478 ## [2.5.4] - 2023-06-07
479
480 ### Added
481
482 - Add Event Loop Utilization (ELU) statistics to worker tasks usage.
483
484 ### Changed
485
486 - Compute statistics at the worker level only if needed.
487 - Add `worker_threads` options to thread pool options.
488
489 ### Fixed
490
491 - Make the `LEAST_BUSY` strategy only relies on task runtime.
492
493 ## [2.5.3] - 2023-06-04
494
495 ### Changed
496
497 - Refine pool information content.
498 - Limit pool internals public exposure.
499
500 ## [2.5.2] - 2023-06-02
501
502 ### Added
503
504 - Add `taskError` pool event for task execution error.
505 - Add pool information `info` property to pool.
506 - Emit pool information on `busy` and `full` pool events.
507
508 ## [2.5.1] - 2023-06-01
509
510 ### Added
511
512 - Add pool option `restartWorkerOnError` to restart worker on uncaught error. Default to `true`.
513 - Add `error` pool event for uncaught worker error.
514
515 ## [2.5.0] - 2023-05-31
516
517 ### Added
518
519 - Switch pool event emitter to `EventEmitterAsyncResource`.
520 - Add tasks wait time accounting in per worker tasks usage.
521 - Add interleaved weighted round robin `INTERLEAVED_WEIGHTED_ROUND_ROBIN` worker choice strategy (experimental).
522
523 ### Changed
524
525 - Renamed worker choice strategy `LESS_BUSY` to `LEAST_BUSY` and `LESS_USED` to `LEAST_USED`.
526
527 ## [2.4.14] - 2023-05-09
528
529 ### Fixed
530
531 - Ensure no undefined task runtime can land in the tasks history.
532 - Fix median computation implementation once again.
533
534 ### Added
535
536 - Unit tests for median and queue implementations.
537
538 ## [2.4.13] - 2023-05-08
539
540 ### Fixed
541
542 - Fix worker choice strategy options validation.
543 - Fix fair share worker choice strategy internals update: ensure virtual task end timestamp is computed at task submission.
544
545 ## [2.4.12] - 2023-05-06
546
547 ### Added
548
549 - Support multiple task functions per worker.
550 - Add custom worker weights support to worker choice strategies options.
551
552 ### Changed
553
554 - Use O(1) queue implementation for tasks queueing.
555
556 ### Fixed
557
558 - Fix median computation implementation.
559 - Fix fair share worker choice strategy internals update.
560
561 ## [2.4.11] - 2023-04-23
562
563 ### Changed
564
565 - Optimize free worker finding in worker choice strategies.
566
567 ## [2.4.10] - 2023-04-15
568
569 ### Fixed
570
571 - Fix typescript type definition for task function: ensure the input data is optional.
572 - Fix typescript type definition for pool execute(): ensure the input data is optional.
573
574 ## [2.4.9] - 2023-04-15
575
576 ### Added
577
578 - Add tasks queue enablement runtime setter to pool.
579 - Add tasks queue options runtime setter to pool.
580 - Add worker choice strategy options runtime setter to pool.
581
582 ### Changed
583
584 - Remove the tasks queuing experimental status.
585
586 ### Fixed
587
588 - Fix task function type definition and validation.
589 - Fix worker choice strategy options handling.
590
591 ## [2.4.8] - 2023-04-12
592
593 ### Fixed
594
595 - Fix message between main worker and worker type definition for tasks.
596 - Fix code documentation.
597
598 ## [2.4.7] - 2023-04-11
599
600 ### Added
601
602 - Add worker tasks queue options to pool options.
603
604 ### Fixed
605
606 - Fix missing documentation.
607
608 ## [2.4.6] - 2023-04-10
609
610 ### Fixed
611
612 - Ensure one task at a time is executed per worker with tasks queueing enabled.
613 - Properly count worker executing tasks with tasks queueing enabled.
614
615 ## [2.4.5] - 2023-04-09
616
617 ### Added
618
619 - Use monotonic high resolution timer for worker tasks runtime.
620 - Add worker tasks median runtime to statistics.
621 - Add worker tasks queue (experimental).
622
623 ## [2.4.4] - 2023-04-07
624
625 ### Added
626
627 - Add `PoolEvents` enumeration and `PoolEvent` type.
628
629 ### Fixed
630
631 - Destroy worker only on alive check.
632
633 ## [2.4.3] - 2023-04-07
634
635 ### Fixed
636
637 - Fix typedoc generation with inheritance.
638
639 ## [2.4.2] - 2023-04-06
640
641 ### Added
642
643 - Add `full` event to dynamic pool.
644 - Keep worker choice strategy in memory for conditional reuse.
645
646 ### Fixed
647
648 - Fix possible negative worker key at worker removal in worker choice strategies.
649
650 ## [2.4.1] - 2023-04-05
651
652 ### Changed
653
654 - Optimize worker choice strategy for dynamic pool.
655
656 ### Fixed
657
658 - Ensure dynamic pool does not alter worker choice strategy expected behavior.
659
660 ## [2.4.0] - 2023-04-04
661
662 ### Added
663
664 - Add `LESS_BUSY` worker choice strategy.
665
666 ### Changed
667
668 - Optimize worker storage in pool.
669 - Optimize worker alive status check.
670 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
671 - Optimize `LESS_USED` worker choice strategy.
672 - Update benchmark versus external threads pools.
673 - Optimize tasks usage statistics requirements for worker choice strategy.
674
675 ### Fixed
676
677 - Ensure trimmable characters are checked at pool initialization.
678 - Fix message id integer overflow.
679 - Fix pool worker removal in worker choice strategy internals.
680 - Fix package publication with pnpm.
681
682 ## [2.4.0-3] - 2023-04-04
683
684 ### Added
685
686 - Add `LESS_BUSY` worker choice strategy.
687
688 ### Changed
689
690 - Optimize worker storage in pool.
691 - Optimize worker alive status check.
692 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
693 - Optimize `LESS_USED` worker choice strategy.
694 - Update benchmark versus external threads pools.
695
696 ### Fixed
697
698 - Ensure trimmable characters are checked at pool initialization.
699 - Fix message id integer overflow.
700 - Fix pool worker removal in worker choice strategy internals.
701 - Fix package publication with pnpm.
702
703 ## [2.4.0-2] - 2023-04-03
704
705 ### Added
706
707 - Add `LESS_BUSY` worker choice strategy.
708
709 ### Changed
710
711 - Optimize worker storage in pool.
712 - Optimize worker alive status check.
713 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
714 - Optimize `LESS_USED` worker choice strategy.
715
716 ### Fixed
717
718 - Ensure trimmable characters are checked at pool initialization.
719 - Fix message id integer overflow.
720 - Fix pool worker removal in worker choice strategy internals.
721 - Fix package publication with pnpm.
722
723 ## [2.4.0-1] - 2023-04-03
724
725 ### Added
726
727 - Add `LESS_BUSY` worker choice strategy.
728
729 ### Changed
730
731 - Optimize worker storage in pool.
732 - Optimize worker alive status check.
733 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
734 - Optimize `LESS_USED` worker choice strategy.
735
736 ### Fixed
737
738 - Ensure trimmable characters are checked at pool initialization.
739 - Fix message id integer overflow.
740 - Fix pool worker removal in worker choice strategy internals.
741
742 ## [2.4.0-0] - 2023-04-03
743
744 ### Added
745
746 - Add `LESS_BUSY` worker choice strategy.
747
748 ### Changed
749
750 - Optimize worker storage in pool.
751 - Optimize worker alive status check.
752 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
753 - Optimize `LESS_USED` worker choice strategy.
754
755 ### Fixed
756
757 - Ensure trimmable characters are checked at pool initialization.
758 - Fix message id integer overflow.
759 - Fix pool worker removal in worker choice strategy internals.
760
761 ## [2.3.10] - 2023-03-18
762
763 ### Fixed
764
765 - Fix package.json `exports` syntax for ESM and CommonJS.
766
767 ### Changed
768
769 - Permit SemVer pre-release publication.
770
771 ## [2.3.10-2] - 2023-03-18
772
773 ### Fixed
774
775 - Fix package.json `exports` syntax for ESM and CommonJS.
776
777 ## [2.3.10-1] - 2023-03-18
778
779 ### Changed
780
781 - Permit SemVer pre-release publication.
782
783 ## [2.3.10-0] - 2023-03-18
784
785 ### Fixed
786
787 - Fix package.json `exports` syntax for ESM and CommonJS.
788
789 ## [2.3.9] - 2023-03-18
790
791 ### Changed
792
793 - Introduce ESM module support along with CommonJS one.
794
795 ### Fixed
796
797 - Fix brown paper bag bug referencing the same object literal.
798
799 ## [2.3.8] - 2023-03-18
800
801 ### Changed
802
803 - Switch internal benchmarking code to benny.
804 - Switch to TypeScript 5.x.x.
805 - Switch rollup bundler plugins to core ones.
806 - Switch to TSDoc syntax.
807 - Enforce conventional commits.
808
809 ### Fixed
810
811 - Fix random integer generator.
812 - Fix worker choice strategy pool type identification at initialization.
813
814 ## [2.3.7] - 2022-10-23
815
816 ### Changed
817
818 - Switch to open collective FOSS project funding platform.
819 - Switch to ts-standard linter configuration on TypeScript code.
820
821 ### Fixed
822
823 - Fixed missing async on pool execute method.
824 - Fixed typing in TypeScript example.
825 - Fixed types in unit tests.
826
827 ## [2.3.6] - 2022-10-22
828
829 ### Changed
830
831 - Cleanup pool attributes and methods.
832 - Refine error types thrown.
833
834 ### Fixed
835
836 - Fix continuous integration build on windows.
837 - Fix code coverage reporting by using c8 instead of nyc.
838
839 ## [2.3.5] - 2022-10-21
840
841 ### Changed
842
843 - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
844 - Optimize tasks usage lookup implementation.
845
846 ### Fixed
847
848 - Fix missed pool event emitter type export.
849 - Fix typedoc documentation generation.
850
851 ## [2.3.4] - 2022-10-17
852
853 ### Added
854
855 - Fully automate release process with release-it.
856
857 ### Changed
858
859 - Optimize fair share task scheduling algorithm implementation.
860 - Update benchmark versus external pools results with latest version.
861
862 ## [2.3.3] - 2022-10-15
863
864 ### Added
865
866 - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
867
868 ## [2.3.2] - 2022-10-14
869
870 ### Changed
871
872 - Optimize fair share worker selection strategy implementation.
873
874 ### Fixed
875
876 - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
877
878 ## [2.3.1] - 2022-10-13
879
880 ### Added
881
882 - Pool worker choice strategies:
883 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
884 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
885
886 ## [2.2.2] - 2022-10-09
887
888 ### Fixed
889
890 - Fixed `README.md` file.
891
892 ## [2.2.1] - 2022-10-08
893
894 ### Added
895
896 - Dynamic worker choice strategy change at runtime.
897
898 ## [2.2.0] - 2022-01-05
899
900 ### Breaking Changes
901
902 - Support only Node.js version 16.x.x for cluster pool: upstream cluster API have changed on that version.
903
904 ## [2.1.0] - 2021-08-29
905
906 ### Added
907
908 - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
909
910 ### Breaking Changes
911
912 - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
913 - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
914 - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
915 - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
916
917 ## [2.0.2] - 2021-05-12
918
919 ### Bug fixes
920
921 - Fix `busy` event emission on fixed pool type
922
923 ## [2.0.1] - 2021-03-16
924
925 ### Bug fixes
926
927 - Check if pool options are properly set.
928 - `busy` event is emitted on all pool types.
929
930 ## [2.0.0] - 2021-03-01
931
932 ### Bug fixes
933
934 - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
935
936 ### Breaking Changes
937
938 - `FullPool` event is now renamed to `busy`.
939 - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
940 _Find more details on our JSDoc._
941
942 - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
943
944 - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
945
946 ### Pool options types declaration merge
947
948 `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
949
950 #### New `export` strategy
951
952 ```js
953 // Before
954 const DynamicThreadPool = require('poolifier/lib/dynamic')
955 // After
956 const { DynamicThreadPool } = require('poolifier/lib/dynamic')
957 ```
958
959 But you should always prefer just using
960
961 ```js
962 const { DynamicThreadPool } = require('poolifier')
963 ```
964
965 #### New type definitions for input data and response
966
967 For cluster worker and worker-thread pools, you can now only send and receive structured-cloneable data.
968 _This is not a limitation by poolifier but Node.js._
969
970 #### Public property replacements
971
972 `numWorkers` property is now `numberOfWorkers`
973
974 #### Internal (protected) properties and methods renaming
975
976 These properties are not intended for end users
977
978 - `id` => `nextMessageId`
979
980 These methods are not intended for end users
981
982 - `_chooseWorker` => `chooseWorker`
983 - `_newWorker` => `createWorker`
984 - `_execute` => `internalExecute`
985 - `_chooseWorker` => `chooseWorker`
986 - `_checkAlive` => `checkAlive`
987 - `_run` => `run`
988 - `_runAsync` => `runAsync`
989
990 ## [1.1.0] - 2020-05-21
991
992 ### Added
993
994 - ThreadWorker support async functions as option
995 - Various external library patches
996
997 ## [1.0.0] - 2020-01-24
998
999 ### Added
1000
1001 - FixedThreadPool implementation
1002 - DynamicThreadPool implementation
1003 - WorkerThread implementation to improve developer experience