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