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