build: update volta pnpm version
[poolifier.git] / CHANGELOG.md
CommitLineData
522eea03 1# Changelog
2
3All notable changes to this project will be documented in this file.
4
d4abc60a 5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
522eea03 6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
45a5a54c
JB
8## [Unreleased]
9
9d2d0da1
JB
10### Fixed
11
12- Fix pool `execute()` arguments check.
13
1f0766e7
JB
14### Changed
15
16- Make continuous tasks stealing algorithm less aggressive.
8780236f 17- Fine tune tasks stealing algorithm under back pressure.
1f0766e7 18
ffd2c1ff
JB
19## [2.6.35] - 2023-08-25
20
dc021bcc
JB
21### Fixed
22
23- Don't account worker usage statistics for tasks that have failed.
3baa0837 24- Fix pool information runtime and wait time median computation.
dc021bcc
JB
25
26### Changed
27
28- Update simple moving average implementation to use a circular buffer.
29- Update simple moving median implementation to use a circular buffer.
68cbdc84
JB
30- Account for stolen tasks in worker usage statistics and pool information.
31
32### Added
33
34- Continuous tasks stealing algorithm.
dc021bcc 35
c58bc2a1
JB
36## [2.6.34] - 2023-08-24
37
0bc68267
JB
38### Fixes
39
40- Avoid cascading tasks stealing under back pressure.
41
42### Changed
43
44- Add fastpath to queued tasks rescheduling.
45
39fb7ad0
JB
46## [2.6.33] - 2023-08-24
47
dd951876
JB
48### Fixed
49
50- Fix queued tasks rescheduling.
51
ff3f866a
JB
52### Changed
53
54- Rename tasks queue options `queueMaxSize` to `size`.
55
a6b3272b 56### Added
dd951876 57
a6b3272b 58- Task stealing scheduling algorithm if tasks queueing is enabled.
dd951876 59
c55c9b5d
JB
60## [2.6.32] - 2023-08-23
61
15b176e0
JB
62### Fixed
63
64- Ensure no task can be executed when the pool is destroyed.
65
20c6f652
JB
66### Added
67
68- Add `queueMaxSize` option to tasks queue options.
574b351d 69- Add O(1) deque implementation implemented with doubly linked list and use it for tasks queueing.
72695f86 70- Add tasks stealing algorithm when a worker node queue is back pressured if tasks queueing is enabled.
20c6f652 71
e560a9f2
JB
72## [2.6.31] - 2023-08-20
73
b1aae695
JB
74### Fixed
75
3e8611a8 76- Fix worker choice strategy retries mechanism in some edge cases.
b1aae695 77
94407def
JB
78### Changed
79
e695d66f 80- Make orthogonal worker choice strategies tasks distribution and created dynamic worker usage.
a71b05bc 81- Remove the experimental status of the `LEAST_ELU` worker choice strategy.
94407def 82
962b9863
JB
83## [2.6.30] - 2023-08-19
84
33e6bb4c
JB
85### Fixed
86
87- Ensure pool event `backPressure` is emitted.
88- Ensure pool event `full` is emitted only once.
8735b4e5 89- Ensure worker node cannot be instantiated without proper arguments.
33e6bb4c 90
8cc4ea81
JB
91## [2.6.29] - 2023-08-18
92
6169563b
JB
93### Fixed
94
95- Fix race condition between ready and task functions worker message handling at startup.
5dd4043c 96- Fix duplicate task function worker usage statistics computation per task function.
db0e38ee 97- Update task function worker usage statistics if and only if there's at least two different task functions.
5bb5be17 98- Fix race condition at task function worker usage executing task computation leading to negative value.
6169563b 99
8990357d
JB
100### Added
101
445264e8 102- 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).
8990357d
JB
103- Use back pressure detection in worker choice strategies.
104- Add worker choice strategies retries mechanism if no worker is eligible.
105
21157987
JB
106## [2.6.28] - 2023-08-16
107
f05ed93c
JB
108### Fixed
109
110- Ensure pool workers are properly initialized.
111
12d67776
JB
112### Added
113
114- HTTP server pool examples: express-cluster, express-hybrid.
115
d18fccb1
JB
116### Changed
117
118- Remove now useless branching in worker hot code path.
119
741cdb34
JB
120## [2.6.27] - 2023-08-15
121
50e7f498
JB
122### Fixed
123
124- Add `KillHandler` type definition to exported types.
125
ef3891a3
JB
126### Added
127
128- Add `destroy` event to pool API.
129
e9dc6efa
JB
130## [2.6.26] - 2023-08-15
131
2b099bf7
JB
132### Added
133
134- Add kill handler to worker options allowing to execute custom code when worker is killed.
ef3891a3 135- Add `listTaskFunctions()` method to pool API.
9aef1431 136- SMTP server pool example: nodemailer.
2b099bf7 137
5b726f72
JB
138## [2.6.25] - 2023-08-13
139
72855e92
JB
140### Added
141
3b311539 142- HTTP server pool examples: fastify-cluster, fastify-hybrid.
02999424 143- WebSocket server pool examples: ws-cluster, ws-hybrid.
72855e92 144
7aadd6e5
JB
145## [2.6.24] - 2023-08-12
146
7d91a8cd
JB
147### Added
148
149- Add array of transferable objects to the `execute()` method arguments.
02999424 150- WebSocket server pool examples: ws-worker_threads.
7d91a8cd 151
6b4263b4
JB
152## [2.6.23] - 2023-08-11
153
3d76750a 154### Fixed
8e0af894 155
3d76750a 156- 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.
9606b474 157
3d76750a
JB
158### Added
159
160- HTTP client pool examples: fetch, node-fetch and axios with multiple task functions.
02999424 161- HTTP server pool examples: express-worker_threads, fastify-worker_threads.
3d76750a
JB
162
163## [2.6.22] - 2023-08-10
9606b474 164
3d76750a 165### Fixed
9606b474
JB
166
167- Add missing `types` field to package.json `exports`.
168
3d76750a
JB
169### Changed
170
171- Structure markdown documentation (PR #811).
172
d9647bdd
JB
173## [2.6.21] - 2023-08-03
174
2111ec12
JB
175### Changed
176
177- Improve code documentation.
178- Code refactoring and cleanup for better maintainability and readability.
179
5c30b9d9
JB
180## [2.6.20] - 2023-07-21
181
10ecf8fd
JB
182### Fixed
183
184- Fix queued tasks redistribution on error task execution starvation.
a1763c54 185- Ensure tasks queueing per worker condition is untangled from the pool busyness semantic.
10ecf8fd 186
aa9eede8
JB
187### Changed
188
7c89e6a4 189- Drastically reduce lookups by worker in the worker nodes.
aa9eede8 190
62485908
JB
191## [2.6.19] - 2023-07-20
192
2e2ef9c3
JB
193### Added
194
195- Dedicated internal communication channel for worker_threads pools.
196
8f4c9491
JB
197## [2.6.18] - 2023-07-19
198
8660b972
JB
199### Changed
200
201- Code refactoring and cleanup for better maintainability and readability. Bundle size is a bit smaller.
202
206a3519
JB
203## [2.6.17] - 2023-07-16
204
b4899fae
JB
205### Added
206
1a3e01ba 207- Add `listTaskFunctions()` method to worker API.
b4899fae 208
58a06a6c
JB
209## [2.6.16] - 2023-07-12
210
2a69b8c5
JB
211### Fixed
212
80520ca4 213- Fix pool startup detection.
2a69b8c5
JB
214- Fix worker task functions handling.
215
b5900b02
JB
216## [2.6.15] - 2023-07-11
217
19dbc45b
JB
218### Added
219
220- Take into account worker node readiness in worker choice strategies.
221
4a0db581
JB
222## [2.6.14] - 2023-07-10
223
87e44747
JB
224### Fixed
225
226- Fix task function statistics tracking.
227
0265272f
JB
228## [2.6.13] - 2023-07-10
229
968a2e8c
JB
230### Added
231
232- Add per task function statistics tracking.
782299f8 233- Add public methods to manipulate the worker task functions at runtime.
968a2e8c 234
44c8c00f
JB
235## [2.6.12] - 2023-07-09
236
aa4bf4b2
JB
237### Fixed
238
239- Workaround import issue with `node:os` module in node 16.x.x.
240
b7cfced1
JB
241## [2.6.11] - 2023-07-09
242
d5024c00
JB
243### Fixed
244
245- Fix pool readiness semantic.
246
f313a208
JB
247## [2.6.10] - 2023-07-08
248
2431bdb4
JB
249### Fixed
250
251- Ensure workers are not recreated on error at pool startup.
252
253### Added
254
255- Add `ready` and `strategy` fields to pool information.
256- Add pool event `ready` to notify when the number of workers created in the pool has reached the maximum size expected and are ready.
caadbd41 257- Add dynamic pool sizing checks.
2431bdb4 258
369d0a51
JB
259## [2.6.9] - 2023-07-07
260
2845f2a5
JB
261### Fixed
262
263- Recreate the right worker type on uncaught exception.
264
265### Added
266
267- Add minimum and maximum to internal measurement statistics.
1dcf8b7b 268- Add `runTime` and `waitTime` to pool information.
75d3401a 269- Check worker inactive time only on dynamic worker.
2845f2a5 270
fc97d613
JB
271## [2.6.8] - 2023-07-03
272
92b1feaa
JB
273### Fixed
274
275- Brown paper bag release to fix version handling in pool information.
276
52d54060
JB
277## [2.6.7] - 2023-07-03
278
5bc91f3e
JB
279### Fixed
280
281- Ensure worker queued tasks at error are reassigned to other pool workers.
282
afe0d5bf
JB
283### Added
284
285- Add pool `utilization` ratio to pool information.
23ccf9d7 286- Add `version` to pool information.
e5b3047d 287- Add worker information to worker nodes.
afe0d5bf 288
f42c583f
JB
289## [2.6.6] - 2023-07-01
290
6961ca9a
JB
291### Added
292
d5e3c4ff 293- Add safe helper `availableParallelism()` to help sizing the pool.
6961ca9a 294
3749facb
JB
295### Fixed
296
297- Ensure message handler is only registered in worker.
298
6fed2513
JB
299## [2.6.5] - 2023-06-27
300
c72f6987
JB
301### Known issues
302
70726c28 303- Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
c72f6987
JB
304
305### Fixed
306
307- Artificial version bump to 2.6.5 to workaround publication issue.
d5e3c4ff 308- Ensure cluster pool `destroy()` gracefully shutdowns worker's server.
c72f6987
JB
309- Ensure pool event is emitted before task error promise rejection.
310- Fix queued tasks count computation.
311
312### Removed
313
2fbe1783 314- Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
c72f6987 315
6426631b
JB
316## [2.6.4] - 2023-06-27
317
941f9a7c
JB
318### Known issues
319
70726c28 320- Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
941f9a7c 321
2c039e43
JB
322### Fixed
323
d5e3c4ff 324- Ensure cluster pool `destroy()` gracefully shutdowns worker's server.
2c039e43 325- Ensure pool event is emitted before task error promise rejection.
9c16fb4b 326- Fix queued tasks count computation.
2c039e43 327
941f9a7c
JB
328### Removed
329
2fbe1783 330- Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
941f9a7c 331
bc1b0765
JB
332## [2.6.3] - 2023-06-19
333
a6a2dc4c
JB
334### Fixed
335
336- Ensure no tasks are queued when trying to soft kill a dynamic worker.
f0d7f803 337- Update strategies internals after statistics computation.
a6a2dc4c 338
7b56f532
JB
339### Changed
340
341- Optimize O(1) queue implementation.
342
b628596c
JB
343## [2.6.2] - 2023-06-12
344
a9e89d00
JB
345### Fixed
346
347- Fix new worker use after creation in dynamic pool given the current worker choice strategy.
348
4368a898
JB
349## [2.6.1] - 2023-06-10
350
931d43e2
JB
351### Added
352
13ab5b87 353- Add worker choice strategy documentation: [README.md](./docs/worker-choice-strategies.md).
931d43e2 354
f1c06930
JB
355### Fixed
356
357- Fix average statistics computation: ensure failed tasks are not accounted.
358
16671b07
JB
359## [2.6.0] - 2023-06-09
360
a1347286
JB
361### Added
362
5af9c0f7 363- Add `LEAST_ELU` worker choice strategy (experimental).
9adcefab 364- Add tasks ELU instead of runtime support to `FAIR_SHARE` worker choice strategy.
a1347286 365
1c6fe997
JB
366### Changed
367
368- Refactor pool worker node usage internals.
477f48e7 369- Breaking change: refactor worker choice strategy statistics requirements: the syntax of the worker choice strategy options has changed.
f63a9dda 370- Breaking change: pool information `info` property object fields have been renamed.
1c6fe997
JB
371
372### Fixed
373
374- Fix wait time accounting.
375- Ensure worker choice strategy `LEAST_BUSY` accounts also tasks wait time.
376- Ensure worker choice strategy `LEAST_USED` accounts also queued tasks.
377
aa07d6ee
JB
378## [2.5.4] - 2023-06-07
379
b6b32453
JB
380### Added
381
382- Add Event Loop Utilization (ELU) statistics to worker tasks usage.
383
384### Changed
385
386- Compute statistics at the worker level only if needed.
2fbe1783 387- Add `worker_threads` options to thread pool options.
b6b32453 388
272d4d8f
JB
389### Fixed
390
391- Make the `LEAST_BUSY` strategy only relies on task runtime.
392
ed47fb3d
JB
393## [2.5.3] - 2023-06-04
394
89a4abfd
JB
395### Changed
396
397- Refine pool information content.
b4213b7f 398- Limit pool internals public exposure.
89a4abfd 399
8a9febf5
JB
400## [2.5.2] - 2023-06-02
401
91ee39ed
JB
402### Added
403
404- Add `taskError` pool event for task execution error.
6b27d407 405- Add pool information `info` property to pool.
91ee39ed
JB
406- Emit pool information on `busy` and `full` pool events.
407
8babb151
JB
408## [2.5.1] - 2023-06-01
409
0e05c4dc
JB
410### Added
411
1f68cede 412- Add pool option `restartWorkerOnError` to restart worker on uncaught error. Default to `true`.
91ee39ed 413- Add `error` pool event for uncaught worker error.
0e05c4dc 414
a8766181
JB
415## [2.5.0] - 2023-05-31
416
e4543b14
JB
417### Added
418
419- Switch pool event emitter to `EventEmitterAsyncResource`.
6da80d38 420- Add tasks wait time accounting in per worker tasks usage.
5af9c0f7 421- Add interleaved weighted round robin `INTERLEAVED_WEIGHTED_ROUND_ROBIN` worker choice strategy (experimental).
e4543b14
JB
422
423### Changed
424
425- Renamed worker choice strategy `LESS_BUSY` to `LEAST_BUSY` and `LESS_USED` to `LEAST_USED`.
426
570efb11
JB
427## [2.4.14] - 2023-05-09
428
b0f28bad
JB
429### Fixed
430
431- Ensure no undefined task runtime can land in the tasks history.
432- Fix median computation implementation once again.
433
110b6d13
JB
434### Added
435
436- Unit tests for median and queue implementations.
437
72584880
JB
438## [2.4.13] - 2023-05-08
439
b0d6ed8f
JB
440### Fixed
441
e3058615 442- Fix worker choice strategy options validation.
b0d6ed8f
JB
443- Fix fair share worker choice strategy internals update: ensure virtual task end timestamp is computed at task submission.
444
06140c32
JB
445## [2.4.12] - 2023-05-06
446
a86b6df1
JB
447### Added
448
449- Support multiple task functions per worker.
08f3f44c 450- Add custom worker weights support to worker choice strategies options.
a86b6df1 451
29ee7e9a
JB
452### Changed
453
454- Use O(1) queue implementation for tasks queueing.
455
0682ba15
JB
456### Fixed
457
458- Fix median computation implementation.
459- Fix fair share worker choice strategy internals update.
460
936d53ec
JB
461## [2.4.11] - 2023-04-23
462
cb70b19d
JB
463### Changed
464
465- Optimize free worker finding in worker choice strategies.
466
15bb637a
JB
467## [2.4.10] - 2023-04-15
468
ef41a6e6
JB
469### Fixed
470
82ea6492 471- Fix typescript type definition for task function: ensure the input data is optional.
ef41a6e6
JB
472- Fix typescript type definition for pool execute(): ensure the input data is optional.
473
181eb2b4
JB
474## [2.4.9] - 2023-04-15
475
a20f0ba5
JB
476### Added
477
478- Add tasks queue enablement runtime setter to pool.
479- Add tasks queue options runtime setter to pool.
480- Add worker choice strategy options runtime setter to pool.
481
482### Changed
483
484- Remove the tasks queuing experimental status.
485
d4aeae5a
JB
486### Fixed
487
82ea6492 488- Fix task function type definition and validation.
2fc5cae3 489- Fix worker choice strategy options handling.
d4aeae5a 490
1d9e7023
JB
491## [2.4.8] - 2023-04-12
492
f9b4bbf8
JB
493### Fixed
494
495- Fix message between main worker and worker type definition for tasks.
496- Fix code documentation.
497
12ae3210
JB
498## [2.4.7] - 2023-04-11
499
7171d33f
JB
500### Added
501
502- Add worker tasks queue options to pool options.
503
e8bd29ce
JB
504### Fixed
505
506- Fix missing documentation.
507
42c7bc10
JB
508## [2.4.6] - 2023-04-10
509
681196cc
JB
510### Fixed
511
512- Ensure one task at a time is executed per worker with tasks queueing enabled.
1c6fe997 513- Properly count worker executing tasks with tasks queueing enabled.
681196cc 514
54d360e3
JB
515## [2.4.5] - 2023-04-09
516
3fafb1b2
JB
517### Added
518
9e775f96
JB
519- Use monotonic high resolution timer for worker tasks runtime.
520- Add worker tasks median runtime to statistics.
ff733df7 521- Add worker tasks queue (experimental).
3fafb1b2 522
92fa3eb6
JB
523## [2.4.4] - 2023-04-07
524
aee46736
JB
525### Added
526
527- Add `PoolEvents` enumeration and `PoolEvent` type.
528
36b5e78f
JB
529### Fixed
530
ff0c2b3e 531- Destroy worker only on alive check.
36b5e78f 532
9fb0f324
JB
533## [2.4.3] - 2023-04-07
534
28cf3617
JB
535### Fixed
536
537- Fix typedoc generation with inheritance.
538
848f0f27
JB
539## [2.4.2] - 2023-04-06
540
164d950a
JB
541### Added
542
543- Add `full` event to dynamic pool.
32417142 544- Keep worker choice strategy in memory for conditional reuse.
164d950a 545
78ab2555
JB
546### Fixed
547
548- Fix possible negative worker key at worker removal in worker choice strategies.
549
79aafe9f
JB
550## [2.4.1] - 2023-04-05
551
9cd39dd4
JB
552### Changed
553
554- Optimize worker choice strategy for dynamic pool.
555
965415bb
JB
556### Fixed
557
558- Ensure dynamic pool does not alter worker choice strategy expected behavior.
559
d8b60b1c
JB
560## [2.4.0] - 2023-04-04
561
c6bd2650
JB
562### Added
563
564- Add `LESS_BUSY` worker choice strategy.
565
566### Changed
567
568- Optimize worker storage in pool.
569- Optimize worker alive status check.
570- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
571- Optimize `LESS_USED` worker choice strategy.
572- Update benchmarks versus external threads pools.
573- Optimize tasks usage statistics requirements for worker choice strategy.
574
575### Fixed
576
577- Ensure trimmable characters are checked at pool initialization.
578- Fix message id integer overflow.
579- Fix pool worker removal in worker choice strategy internals.
580- Fix package publication with pnpm.
581
d0a3f018
JB
582## [2.4.0-3] - 2023-04-04
583
b2ede285
JB
584### Added
585
586- Add `LESS_BUSY` worker choice strategy.
587
588### Changed
589
590- Optimize worker storage in pool.
591- Optimize worker alive status check.
592- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
593- Optimize `LESS_USED` worker choice strategy.
594- Update benchmarks versus external threads pools.
595
596### Fixed
597
598- Ensure trimmable characters are checked at pool initialization.
599- Fix message id integer overflow.
600- Fix pool worker removal in worker choice strategy internals.
601- Fix package publication with pnpm.
602
a015ea40
JB
603## [2.4.0-2] - 2023-04-03
604
698f4bbc
JB
605### Added
606
607- Add `LESS_BUSY` worker choice strategy.
608
609### Changed
610
611- Optimize worker storage in pool.
612- Optimize worker alive status check.
613- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
614- Optimize `LESS_USED` worker choice strategy.
615
616### Fixed
617
618- Ensure trimmable characters are checked at pool initialization.
619- Fix message id integer overflow.
620- Fix pool worker removal in worker choice strategy internals.
621- Fix package publication with pnpm.
622
8fe15920
JB
623## [2.4.0-1] - 2023-04-03
624
5b301c28
JB
625### Added
626
627- Add `LESS_BUSY` worker choice strategy.
628
629### Changed
630
631- Optimize worker storage in pool.
632- Optimize worker alive status check.
633- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
634- Optimize `LESS_USED` worker choice strategy.
635
636### Fixed
637
638- Ensure trimmable characters are checked at pool initialization.
639- Fix message id integer overflow.
640- Fix pool worker removal in worker choice strategy internals.
641
2fb9ca9c
JB
642## [2.4.0-0] - 2023-04-03
643
168c526f
JB
644### Added
645
646- Add `LESS_BUSY` worker choice strategy.
647
1d71a908
JB
648### Changed
649
ffcbbad8 650- Optimize worker storage in pool.
1d71a908 651- Optimize worker alive status check.
65a60b3b 652- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
737c6d97 653- Optimize `LESS_USED` worker choice strategy.
1d71a908 654
ffcbbad8
JB
655### Fixed
656
657- Ensure trimmable characters are checked at pool initialization.
b4e75778 658- Fix message id integer overflow.
97a2abc3 659- Fix pool worker removal in worker choice strategy internals.
ffcbbad8 660
08372738
JB
661## [2.3.10] - 2023-03-18
662
710826bc
JB
663### Fixed
664
9606b474 665- Fix package.json `exports` syntax for ESM and CommonJS.
710826bc
JB
666
667### Changed
668
669- Permit SemVer pre-release publication.
76e5ac6f 670
e4796ecd
JB
671## [2.3.10-2] - 2023-03-18
672
6abad580
JB
673### Fixed
674
9606b474 675- Fix package.json `exports` syntax for ESM and CommonJS.
6abad580 676
a2ee98cc
JB
677## [2.3.10-1] - 2023-03-18
678
7e060cee
JB
679### Changed
680
90483887 681- Permit SemVer pre-release publication.
7e060cee 682
c81bfafb
JB
683## [2.3.10-0] - 2023-03-18
684
fe18768d
JB
685### Fixed
686
9606b474 687- Fix package.json `exports` syntax for ESM and CommonJS.
fe18768d 688
d7b78217
JB
689## [2.3.9] - 2023-03-18
690
ed6dd37f
JB
691### Changed
692
693- Introduce ESM module support along with CommonJS one.
694
695### Fixed
696
697- Fix brown paper bag bug referencing the same object literal.
698
68e2ad86
JB
699## [2.3.8] - 2023-03-18
700
ca6c7d70
JB
701### Changed
702
703- Switch internal benchmarking code to benny.
fbdedeb9
JB
704- Switch to TypeScript 5.x.x.
705- Switch rollup bundler plugins to core ones.
ed6dd37f 706- Switch to TSDoc syntax.
fbdedeb9 707- Enforce conventional commits.
ca6c7d70 708
d15211d4
JB
709### Fixed
710
711- Fix random integer generator.
fbdedeb9 712- Fix worker choice strategy pool type identification at initialization.
d15211d4 713
995705ea
JB
714## [2.3.7] - 2022-10-23
715
b953022b
JB
716### Changed
717
718- Switch to open collective FOSS project funding platform.
78cea37e
JB
719- Switch to ts-standard linter configuration on TypeScript code.
720
721### Fixed
722
723- Fixed missing async on pool execute method.
724- Fixed typing in TypeScript example.
725- Fixed types in unit tests.
b953022b 726
3b9f6953
JB
727## [2.3.6] - 2022-10-22
728
f80cead4
JB
729### Changed
730
731- Cleanup pool attributes and methods.
732- Refine error types thrown.
733
734### Fixed
735
736- Fix continuous integration build on windows.
737- Fix code coverage reporting by using c8 instead of nyc.
738
efc22107
JB
739## [2.3.5] - 2022-10-21
740
7a6a0a96
JB
741### Changed
742
a05c10de
JB
743- Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
744- Optimize tasks usage lookup implementation.
7a6a0a96 745
b4904890
JB
746### Fixed
747
748- Fix missed pool event emitter type export.
749- Fix typedoc documentation generation.
750
a875f8d1
JB
751## [2.3.4] - 2022-10-17
752
73cda448
JB
753### Added
754
755- Fully automate release process with release-it.
756
45a5a54c
JB
757### Changed
758
73cda448 759- Optimize fair share task scheduling algorithm implementation.
eb4a8a82 760- Update benchmarks versus external pools results with latest version.
45a5a54c 761
90ee1b18 762## [2.3.3] - 2022-10-15
1a76932b
JB
763
764### Added
765
766- Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
767
90ee1b18 768## [2.3.2] - 2022-10-14
11df3590
JB
769
770### Changed
771
772- Optimize fair share worker selection strategy implementation.
773
774### Fixed
775
776- Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
777
90ee1b18 778## [2.3.1] - 2022-10-13
23ff945a
JB
779
780### Added
781
782- Pool worker choice strategies:
783 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
784 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
785
90ee1b18 786## [2.2.2] - 2022-10-09
cb2b6c69
JB
787
788### Fixed
789
790- Fixed `README.md` file.
791
90ee1b18 792## [2.2.1] - 2022-10-08
bdacc2d2 793
bdaf31cd
JB
794### Added
795
796- Dynamic worker choice strategy change at runtime.
bdacc2d2 797
90ee1b18 798## [2.2.0] - 2022-01-05
7e0d447f
JB
799
800### Breaking Changes
801
9606b474 802- Support only Node.js version 16.x.x for cluster pool: upstream cluster API have changed on that version.
7e0d447f 803
90ee1b18 804## [2.1.0] - 2021-08-29
35cf1c03
JB
805
806### Added
807
808- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
e088a00c
JB
809
810### Breaking Changes
811
812- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
813- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
814- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
c365b2d3 815- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
e088a00c 816
90ee1b18 817## [2.0.2] - 2021-05-12
14916bf9
JB
818
819### Bug fixes
820
821- Fix `busy` event emission on fixed pool type
822
90ee1b18 823## [2.0.1] - 2021-03-16
7f685093
JB
824
825### Bug fixes
826
827- Check if pool options are properly set.
828- `busy` event is emitted on all pool types.
829
90ee1b18 830## [2.0.0] - 2021-03-01
fa0f5b28 831
f3f833ab 832### Bug fixes
d63d3be3 833
ddbeaffd 834- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
d63d3be3 835
fa0f5b28
S
836### Breaking Changes
837
7f685093 838- `FullPool` event is now renamed to `busy`.
1927ee67 839- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
1a81f8af 840 _Find more details on our JSDoc._
ddbeaffd 841
1927ee67
APA
842- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
843
ddbeaffd 844- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
fa0f5b28 845
ec2ccfc8
JB
846### Pool options types declaration merge
847
848`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
849
fa0f5b28
S
850#### New `export` strategy
851
852```js
853// Before
0eee77cb 854const DynamicThreadPool = require('poolifier/lib/dynamic')
fa0f5b28 855// After
0eee77cb 856const { DynamicThreadPool } = require('poolifier/lib/dynamic')
fa0f5b28
S
857```
858
859But you should always prefer just using
860
861```js
0eee77cb 862const { DynamicThreadPool } = require('poolifier')
fa0f5b28
S
863```
864
d3c8a1a8
S
865#### New type definitions for input data and response
866
6677a3d3 867For cluster worker and worker-thread pools, you can now only send and receive structured-cloneable data.
9606b474 868_This is not a limitation by poolifier but Node.js._
d3c8a1a8 869
3a4b605f 870#### Public property replacements
5c5a1fb7 871
3a4b605f 872`numWorkers` property is now `numberOfWorkers`
5c5a1fb7 873
280c2a77 874#### Internal (protected) properties and methods renaming
fa0f5b28 875
280c2a77
S
876These properties are not intended for end users
877
878- `id` => `nextMessageId`
879
880These methods are not intended for end users
fa0f5b28
S
881
882- `_chooseWorker` => `chooseWorker`
280c2a77 883- `_newWorker` => `createWorker`
fa0f5b28
S
884- `_execute` => `internalExecute`
885- `_chooseWorker` => `chooseWorker`
886- `_checkAlive` => `checkAlive`
887- `_run` => `run`
888- `_runAsync` => `runAsync`
889
90ee1b18 890## [1.1.0] - 2020-05-21
0312f71a
APA
891
892### Added
893
894- ThreadWorker support async functions as option
cf9aa6c3 895- Various external library patches
0312f71a 896
90ee1b18 897## [1.0.0] - 2020-01-24
522eea03 898
899### Added
900
901- FixedThreadPool implementation
902- DynamicThreadPool implementation
0312f71a 903- WorkerThread implementation to improve developer experience