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