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