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