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