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