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