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