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