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