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