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