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