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