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