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