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