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