fix: null exception when a task errored
[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
c2161373
JB
8## [4.0.17](https://github.com/poolifier/poolifier/compare/v4.0.16...v4.0.17) (2024-07-07)
9
c2161373
JB
10### ⚡ Performance
11
1823a63f 12- optimize tasks queuing implementation ([097dea6](https://github.com/poolifier/poolifier/commit/097dea68fd73ac0d6f6db7b13c585bf8b6726418))
c2161373
JB
13
14### ✨ Polish
15
1823a63f
JB
16- factor out fixed queue common code in an abstract class ([840270a](https://github.com/poolifier/poolifier/commit/840270a0f49c9d845f9b2850a36853e1d709f740))
17- format code ([9183b88](https://github.com/poolifier/poolifier/commit/9183b8807bdac35067a22362216d1deadc16421f))
18- move queueing code into its own directory ([c6dd1ae](https://github.com/poolifier/poolifier/commit/c6dd1aeb73ee5d5dd5bbfa9ebd9c4496a60f1252))
19- refine queue full error message ([9008a96](https://github.com/poolifier/poolifier/commit/9008a9668154357ce942ec56caa95dfc3fc08238))
20- remove duplicate code in fixed-queue.ts ([7a1c77f](https://github.com/poolifier/poolifier/commit/7a1c77f62bf4a16d3cd482d479e92e1cd4b1354b))
c2161373
JB
21
22### 📚 Documentation
23
1823a63f 24- generate documentation ([a7ee49b](https://github.com/poolifier/poolifier/commit/a7ee49b03e5a2ee6bd1a1b74a2fe3a2fb7c23404))
c2161373
JB
25
26### 🤖 Automation
27
1823a63f
JB
28- **ci:** fix automated documentation publication at releasing ([147c01e](https://github.com/poolifier/poolifier/commit/147c01eadb3b951b84487c4328f553f95b16fb47))
29- **deps-dev:** bump @cspell/eslint-plugin from 8.10.1 to 8.10.2 ([4f10a83](https://github.com/poolifier/poolifier/commit/4f10a833ef225ac7dbebf9faa16de9c89c8fdf5b))
30- **deps-dev:** bump @types/node ([1d24d0e](https://github.com/poolifier/poolifier/commit/1d24d0e543ebbbb4b3582d29c726cd1621643ca2))
31- **deps-dev:** bump @types/node ([ffa4f4f](https://github.com/poolifier/poolifier/commit/ffa4f4f21af0b1591c10c3e53aa929e94f825e99))
32- **deps-dev:** bump @types/node ([1fe2514](https://github.com/poolifier/poolifier/commit/1fe2514362ede951510d751dac37e7c279a22ec1))
33- **deps-dev:** bump @types/node ([e90a256](https://github.com/poolifier/poolifier/commit/e90a256eb79bc279127cb4021adf58f9fd300ed2))
34- **deps-dev:** bump @types/node ([0bf1a17](https://github.com/poolifier/poolifier/commit/0bf1a17388ea8730fb01dc5cb50a8eccf9e18776))
35- **deps-dev:** bump @types/node ([dd73d0c](https://github.com/poolifier/poolifier/commit/dd73d0c5c9a4e0bf9ba32dc167807356f0b4857d))
36- **deps-dev:** bump @types/node ([2be2259](https://github.com/poolifier/poolifier/commit/2be2259b5dc04eb137210dead6a64dd4cac754b1))
37- **deps-dev:** bump @types/node ([828a2e0](https://github.com/poolifier/poolifier/commit/828a2e030c8777b7fd5a342b693f9e75beb7b9cf))
38- **deps-dev:** bump @types/node ([7109e5b](https://github.com/poolifier/poolifier/commit/7109e5b3b0a6d2e3f3391003be9539eb8fd8bd14))
39- **deps-dev:** bump @types/node ([6f81d57](https://github.com/poolifier/poolifier/commit/6f81d5738358fa5cf67e28402823097c08594eb7))
40- **deps-dev:** bump @types/node ([dc6b47a](https://github.com/poolifier/poolifier/commit/dc6b47a68c6c90b41cedde8e79d0c89709c47d87))
41- **deps-dev:** bump @types/node from 20.14.9 to 20.14.10 ([4c07331](https://github.com/poolifier/poolifier/commit/4c073317e4ad123465ecfdc99491e0291d3fd23d))
42- **deps:** bump poolifier ([9b11cba](https://github.com/poolifier/poolifier/commit/9b11cbaa8455a707c258312a650953eff5de0134))
43- **deps:** bump poolifier ([4c39d13](https://github.com/poolifier/poolifier/commit/4c39d13d36114a267be20a173c60748c6ec5a781))
44- **deps:** bump poolifier ([b0ad3bc](https://github.com/poolifier/poolifier/commit/b0ad3bc6f5ec8e41009b5e81a1fd8f7fe1c4d7a0))
45- **deps:** bump poolifier ([aa6ea2c](https://github.com/poolifier/poolifier/commit/aa6ea2cc4d821059d32337b12c796c2fcfd85a67))
46- **deps:** bump poolifier ([ec4d611](https://github.com/poolifier/poolifier/commit/ec4d611b0e5edab030049780ff9fbbcfc19ad8ee))
47- **deps:** bump poolifier ([cc4e9f0](https://github.com/poolifier/poolifier/commit/cc4e9f0106040f64e56997a51ec5b0004964e789))
48- **deps:** bump poolifier ([6e1b4de](https://github.com/poolifier/poolifier/commit/6e1b4deb9d36d5bf1f50f506683a11766cbe50de))
49- **deps:** bump poolifier ([8e21198](https://github.com/poolifier/poolifier/commit/8e2119854c17a555b3d5eb003afca5ab46bc85bc))
50- **deps:** bump poolifier in /examples/typescript/http-client-pool ([7961830](https://github.com/poolifier/poolifier/commit/796183039d0ad99114f0cff66513ac4165016678))
51- **deps:** bump poolifier in /examples/typescript/smtp-client-pool ([475dc40](https://github.com/poolifier/poolifier/commit/475dc409159cc97c715d2706ba68dd088be4026b))
c2161373 52
3b637906
JB
53## [4.0.16](https://github.com/poolifier/poolifier/compare/v4.0.15...v4.0.16) (2024-07-05)
54
3b637906
JB
55### 📚 Documentation
56
1823a63f
JB
57- generate documentation ([224d008](https://github.com/poolifier/poolifier/commit/224d008191f52fa20b93e1ba67919569f8d6e315))
58- generate documentation ([627fc57](https://github.com/poolifier/poolifier/commit/627fc572465ba2113cbf3df6bd055c3242ecd0fe))
59- refine PR template ([f5e9127](https://github.com/poolifier/poolifier/commit/f5e91274ea67f61521fadf0ccbafc6d00f5d3b87))
60- refine PR template ([e95501c](https://github.com/poolifier/poolifier/commit/e95501c05febf08366d375218728d5778432c1de))
61- refine README.md badges ([7169bda](https://github.com/poolifier/poolifier/commit/7169bda30538a5244b2598a4ef466c5687953ebd))
3b637906
JB
62
63### ✨ Polish
64
1823a63f
JB
65- **ci:** cleanup GH actions ([c5db2d3](https://github.com/poolifier/poolifier/commit/c5db2d3ea50692486410eb1a33e5bb51d6d4181e))
66- code reformatting ([fe6df28](https://github.com/poolifier/poolifier/commit/fe6df2852c1f0964cdffb0698461c9d66b1cf7ed))
67- refine biome.js configuration ([1352ca7](https://github.com/poolifier/poolifier/commit/1352ca70c0b5c6b4ff3813b0c24354b5514b2796))
68- silence linter ([a17b6fe](https://github.com/poolifier/poolifier/commit/a17b6fe6a9b7cde367fa1f1a0a89f6ee5db46ad6))
3b637906
JB
69
70### 🤖 Automation
71
1823a63f
JB
72- **ci:** add autofix GH action ([14b39b9](https://github.com/poolifier/poolifier/commit/14b39b9c09ab382fa25dcb0d52c50b6d05a3affb))
73- **ci:** do not cancel workflow in case of autofix failure ([177dbab](https://github.com/poolifier/poolifier/commit/177dbab8accac6267be8973103757de31f4a4c23))
74- **ci:** fix autofix GH action ([e3a9678](https://github.com/poolifier/poolifier/commit/e3a9678311f735b7c951c5d72f26ef86c7beca9c))
75- **ci:** fix autofix GH action ([0b7cbf7](https://github.com/poolifier/poolifier/commit/0b7cbf73dfdc8346132c002ba9c83fdafe286ee2))
76- **ci:** fix eslint configuration ([c5d7f73](https://github.com/poolifier/poolifier/commit/c5d7f736e1e8c36a2c2d9cbe30e86d1d3ba863a1))
77- **ci:** publish documentation at release ([3a83d94](https://github.com/poolifier/poolifier/commit/3a83d94cd44b504e3b9a3f3b15e9dec4f8c33d49))
78- **ci:** refine autofix GH action ([8b7aa42](https://github.com/poolifier/poolifier/commit/8b7aa4204c27efd1dc699f7baea65b5262bd26b3))
79- **ci:** refine autofix GH action ([8ab143b](https://github.com/poolifier/poolifier/commit/8ab143bb67ef7fb367d771c652cc44df70c9b625))
80- **ci:** switch to release-please release manager ([4c7e68a](https://github.com/poolifier/poolifier/commit/4c7e68aa71533a8ef98296d2f50a2aac898d6b17))
81- **deps-dev:** apply updates ([5c48a85](https://github.com/poolifier/poolifier/commit/5c48a8596b49dec06ec8995df4941ad63cc68f46))
82- **deps-dev:** apply updates ([f94bb23](https://github.com/poolifier/poolifier/commit/f94bb23c8a460415f01bee2a34bf1e56b74236a8))
83- **deps-dev:** apply updates ([1e98512](https://github.com/poolifier/poolifier/commit/1e9851233c950074ccbb5cd525fc0f4075e491d4))
84- **deps-dev:** apply updates ([aaceda9](https://github.com/poolifier/poolifier/commit/aaceda9e4a134d9f8d3db37e349a18e7b2b1c303))
85- **deps-dev:** apply updates ([3dcc95e](https://github.com/poolifier/poolifier/commit/3dcc95e54a6bfeb4b27460d60d3c90d27ac352dd))
86- **deps-dev:** apply updates ([0aa0016](https://github.com/poolifier/poolifier/commit/0aa00166eaa9a8c9b505b4fa7fd5dc50d831b7ef))
87- **deps-dev:** apply updates ([dea4237](https://github.com/poolifier/poolifier/commit/dea42379cfdbcf1c1c9800df7c097eab484ebc07))
88- **deps-dev:** apply updates ([e06ce0e](https://github.com/poolifier/poolifier/commit/e06ce0ec82c8c076d6136f85f12101181d922612))
89- **deps-dev:** apply updates ([80605a6](https://github.com/poolifier/poolifier/commit/80605a6c89c41c5b71e83385f615f85483987ea1))
90- **deps-dev:** apply updates ([3b594fe](https://github.com/poolifier/poolifier/commit/3b594fe1b0f89d6665da2eb2ebdc14eb7628fe70))
91- **deps-dev:** apply updates ([df01d9a](https://github.com/poolifier/poolifier/commit/df01d9a8a7053a4ff33e704cd5493f0a7bc4e2e7))
92- **deps-dev:** apply updates ([a1b4a65](https://github.com/poolifier/poolifier/commit/a1b4a65143c0253b57fee18affd88a554122e955))
93- **deps-dev:** apply updates ([31a42de](https://github.com/poolifier/poolifier/commit/31a42de7d691911759e12a673e5a2153f5558ed8))
94- **deps-dev:** bump @cspell/eslint-plugin from 8.9.0 to 8.9.1 ([0b4d6a4](https://github.com/poolifier/poolifier/commit/0b4d6a4b0255f0172da50a9ba3989d21725027a5))
95- **deps-dev:** bump eslint-plugin-jsdoc from 48.2.13 to 48.4.0 ([195a874](https://github.com/poolifier/poolifier/commit/195a874e9537a715e04b54e44c9a4eef04b1fefa))
96- **deps-dev:** bump mocha from 10.4.0 to 10.5.0 ([b1b2093](https://github.com/poolifier/poolifier/commit/b1b20933105fb3c21f3d3825dc18a87501ad8275))
97- **deps-dev:** bump mocha from 10.5.1 to 10.5.2 ([a4d1195](https://github.com/poolifier/poolifier/commit/a4d1195cd5b6d60f0d4424b32c638d304023e15e))
98- **deps-dev:** bump neostandard from 0.7.2 to 0.8.0 ([7344812](https://github.com/poolifier/poolifier/commit/7344812ff30f82f3b7b88383eca5564c398d2de0))
99- **deps-dev:** bump typedoc from 0.26.0 to 0.26.2 ([8004ea7](https://github.com/poolifier/poolifier/commit/8004ea76f77c3dee098569b37bc9dec9e82f8fe3))
100- **deps-dev:** bump typescript ([fca1e52](https://github.com/poolifier/poolifier/commit/fca1e522f2df0e93e302e6278dc4725b2e28f561))
101- **deps-dev:** bump typescript ([345d416](https://github.com/poolifier/poolifier/commit/345d416980bd3204398e730ca259d1755dcd0f64))
102- **deps-dev:** bump typescript ([3aa8d66](https://github.com/poolifier/poolifier/commit/3aa8d6646706dd32bbd96795330f0a5365d52efa))
103- **deps-dev:** bump typescript ([8837306](https://github.com/poolifier/poolifier/commit/8837306853d6b01efaf67bf69f129fc9ca47b071))
104- **deps-dev:** bump typescript ([0b79799](https://github.com/poolifier/poolifier/commit/0b797997c9340aac75c7be6e5559b08076c387e7))
105- **deps-dev:** bump typescript ([995d429](https://github.com/poolifier/poolifier/commit/995d429cce313177943d54e9c1f3e02a1cdc8c31))
106- **deps-dev:** bump typescript ([2905914](https://github.com/poolifier/poolifier/commit/2905914e6e410cff2a1f8a75c8184abf701d7a16))
107- **deps-dev:** bump typescript ([f2c2f1b](https://github.com/poolifier/poolifier/commit/f2c2f1b196b0cac64235304b5df4b24a97d09ffb))
108- **deps-dev:** bump typescript ([37b0774](https://github.com/poolifier/poolifier/commit/37b07742956c3d25debda0048a60afd3659b547f))
109- **deps-dev:** bump typescript ([f4a2509](https://github.com/poolifier/poolifier/commit/f4a2509b88456b0f6d16c8348c1e07470a94415f))
110- **deps-dev:** bump typescript ([97bb99a](https://github.com/poolifier/poolifier/commit/97bb99ac1e28c87f59b75ea23a9c6643a8fba9c4))
111- **deps:** bump poolifier ([5d5410e](https://github.com/poolifier/poolifier/commit/5d5410ec4203bc1ffa0a81fa52de85971916fed8))
112- **deps:** bump poolifier ([177e46b](https://github.com/poolifier/poolifier/commit/177e46bb9cab33ad65c64b3dd5fd524bb0ac1eef))
113- **deps:** bump poolifier ([580433b](https://github.com/poolifier/poolifier/commit/580433bc22585b6565a3404466a13e5babfd23fa))
114- **deps:** bump poolifier ([a0583d4](https://github.com/poolifier/poolifier/commit/a0583d40e971f43f47b79fd049e99c069db8cac1))
115- **deps:** bump poolifier ([161136f](https://github.com/poolifier/poolifier/commit/161136fe626ea7de93956b2e1e6228ffd6eba209))
116- **deps:** bump poolifier ([70075ce](https://github.com/poolifier/poolifier/commit/70075ce9218f5a5a07c0decf0068775ae351c356))
117- **deps:** bump poolifier ([d74c068](https://github.com/poolifier/poolifier/commit/d74c0684cb549b12897e79e31508b3cad5152456))
118- **deps:** bump poolifier ([b8e4e7d](https://github.com/poolifier/poolifier/commit/b8e4e7dec768e992ba38e29dee0a0194eeb4fd50))
119- **deps:** bump poolifier ([239d223](https://github.com/poolifier/poolifier/commit/239d22372bddd21106b22361038be2f3aae6e5de))
120- **deps:** bump poolifier in /examples/typescript/http-client-pool ([1e6c12d](https://github.com/poolifier/poolifier/commit/1e6c12d988c87fdf1f95a2ffece8c1c76e49bcf3))
121- **deps:** bump poolifier in /examples/typescript/smtp-client-pool ([4c29535](https://github.com/poolifier/poolifier/commit/4c29535a8e8669608907f0db799efa1c94f17421))
122- **deps:** bump ws ([5ae7d26](https://github.com/poolifier/poolifier/commit/5ae7d26a61d9a13e49ccde6117c02d26f49d841d))
123- **deps:** bump ws ([5fea98e](https://github.com/poolifier/poolifier/commit/5fea98eac18f518cb3c76dfed5e514e1aa27ecee))
124- **deps:** bump ws ([cf6f83d](https://github.com/poolifier/poolifier/commit/cf6f83dd588e71b440f1454dd592c1e8029ada6d))
3b637906 125
e8701e36
JB
126## [4.0.15] - 2024-06-20
127
017f9985
JB
128### Fixed
129
130- Fix priority queue dequeue() from the last prioritized bucket.
131
13b6dfca
JB
132## [4.0.14] - 2024-06-12
133
1b82b7cd
JB
134### Changed
135
262e9314 136- Add mapExecute() helper to execute a task function on an iterable data's input.
1b82b7cd 137
b3b1857b
JB
138## [4.0.13] - 2024-05-29
139
fcfc3353
JB
140### Changed
141
142- Optimize tasks queue implementation.
143- Enable prioritized tasks queueing only when necessary.
144
8e41ea40
JB
145## [4.0.12] - 2024-05-25
146
cccbe18a
JB
147### Changed
148
149- Optimize circular buffer implementation to store task execution measurements.
150
b537ee9c
JB
151## [4.0.11] - 2024-05-21
152
05a852b8
JB
153### Changed
154
686b339e 155- Switch to optimized circular buffer implementation to store task execution measurements.
05a852b8 156
40d04d55
JB
157## [4.0.10] - 2024-05-20
158
152e87a8
JB
159### Fixed
160
161- Ensure tasks stealing dynamic worker node is not destroyed on inactivity.
162
ea2c5b8b
JB
163## [4.0.9] - 2024-05-19
164
b947a3c0
JB
165### Changed
166
167- Add ELU `utilization` statistics to pool information.
168
a19a4833
JB
169## [4.0.8] - 2024-05-15
170
91041638
JB
171### Fixed
172
173- Fix default task function worker choice strategy and priority handling.
174
71ccb3ae
JB
175## [4.0.7] - 2024-05-13
176
533a8e22
JB
177### Changed
178
179- Add ELU statistics to pool information.
180
f829e037
JB
181## [4.0.6] - 2024-05-10
182
8a7b12f1
JB
183### Fixed
184
185- Fix pools' `addTaskFunction()` type definition.
186
7cdb9e56
JB
187## [4.0.5] - 2024-05-09
188
3e645903
JB
189### Fixed
190
191- Avoid queued tasks redistribution on the errored worker node.
192
97c12ef2
JB
193## [4.0.4] - 2024-05-08
194
2eee7220
JB
195### Fixed
196
197- Disable `tasksStealingOnBackPressure` by default until performance issues under heavy load are sorted out.
198
04f996c1
JB
199## [4.0.3] - 2024-05-08
200
0d4e88b3
JB
201### Changed
202
203- Optimize task(s) stealing by dequeuing task(s) from the last prioritized bucket.
204
0de45de9
JB
205## [4.0.2] - 2024-05-06
206
9a55fa8c
JB
207### Fixed
208
209- Ensure poolifier worker task performance measurement requirements are synchronized with task function objects' worker choice strategies.
210
840d1755
JB
211## [4.0.1] - 2024-05-02
212
e0843544
JB
213### Fixed
214
215- Ensure dynamic worker node are initialized with sensible worker node usage default values to avoid worker choice strategies biased decisions.
216- Account for tasks wait time in task execution time computation in worker choice strategies to avoid biased decisions under load with several prioritized task functions and tasks queue enabled.
217
f18b1430
JB
218## [4.0.0] - 2024-04-30
219
f7a08a34
JB
220### Changed
221
3e3e2e5d
JB
222- Support per task function(s) priority and worker choice strategy definition via a task function object: `{ taskFunction: (data?: Data) => Response | Promise<Response>, priority?: number, strategy?: WorkerChoiceStrategy }`.
223- Add priority queue based tasks queueing. One priority queue is divided into prioritized buckets to avoid queued tasks starvation under load.
f7a08a34 224- BREAKING CHANGE: `listTaskFunctionNames()` to `listTaskFunctionsProperties()` in pool and worker API returning registered task functions properties.
3e3e2e5d
JB
225- BREAKING CHANGE: `strategy` field in pool information renamed to `defaultStrategy`.
226
227### Fixed
228
229- Ensure worker choice strategy options changes at runtime are propagated to poolifier workers.
f7a08a34 230
48eab590
JB
231## [3.1.30] - 2024-04-22
232
3e3e2e5d 233### Fixed
22bcc4f1
JB
234
235- Fix `transferList` argument type definition.
236
a2568a26
JB
237## [3.1.29] - 2024-04-02
238
3d720596
JB
239### Fixed
240
241- Fix possible race condition at worker node recreation on worker `error` and `exit` events.
242
d1fc382e
JB
243## [3.1.28] - 2024-04-01
244
60dc0a9c
JB
245### Fixed
246
247- Ensure the minimum number of workers on a started pool is guaranteed.
248
cf4c4b77
JB
249## [3.1.27] - 2024-03-27
250
1fee4f60
JB
251### Fixed
252
253- Fix publishing on JSR, take 4.
254
ac1f550f
JB
255## [3.1.26] - 2024-03-27
256
4ba59505
JB
257### Fixed
258
259- Fix publishing on JSR, take 3.
260
3b58238c
JB
261## [3.1.25] - 2024-03-27
262
41328ae5
JB
263### Fixed
264
265- Fix publishing on JSR, take 2.
266
8fddc9ad
JB
267## [3.1.24] - 2024-03-27
268
fcc6278e
JB
269### Fixed
270
271- Fix publishing on JSR.
272
7586f5a8
JB
273## [3.1.23] - 2024-03-27
274
b7bb8586
JB
275### Changed
276
277- Publish on JSR.
278
01f4a5ce
JB
279## [3.1.22] - 2024-03-15
280
d67bed32
JB
281### Fixed
282
283- Fix pool event emitter registered callbacks removal at `destroy()`.
284
6fd820e6
JB
285## [3.1.21] - 2024-02-22
286
369179f6
JB
287### Fixed
288
289- Fix null exception regression: [#1496](https://github.com/poolifier/poolifier/issues/1496).
290
c96e6364
JB
291## [3.1.20] - 2024-02-11
292
d20cde84
JB
293### Fixed
294
295- Ensure `worker_threads` workers are unreferenced at termination.
296
a7358578
JB
297## [3.1.19] - 2024-01-16
298
16d7e943
JB
299### Fixed
300
301- Fix possible null exception at task finishing handling.
302
57bf289f
JB
303### Changed
304
305- Optimize Deque implementation to improve tasks queueing performance.
306
7cf320c9
JB
307## [3.1.18] - 2024-01-06
308
6d7beb8c
JB
309### Fixed
310
311- Fix dynamic pool with minimum number of workers set to zero: [#1748](https://github.com/poolifier/poolifier/issues/1748).
312
a4bc8d0e
JB
313## [3.1.17] - 2024-01-05
314
2b6b412f
JB
315### Changed
316
317- Improve performance by clean up unneeded condition checks on hot code paths.
318
0d64fd53
JB
319## [3.1.16] - 2024-01-03
320
4302d959
JB
321### Fixed
322
323- Add missing type to TS type definitions.
324
9122cc2c
JB
325## [3.1.15] - 2024-01-02
326
a4d25410
JB
327### Fixed
328
329- Fix CommonJS support with TypeScript: [#1821](https://github.com/poolifier/poolifier/issues/1821).
330
565b7e65
JB
331## [3.1.15-0] - 2024-01-02
332
63406ebd
JB
333### Fixed
334
a4d25410 335- Fix CommonJS support with TypeScript: [#1821](https://github.com/poolifier/poolifier/issues/1821).
63406ebd 336
56412ef4
JB
337## [3.1.14] - 2024-01-01
338
e44639e9
JB
339### Fixed
340
341- Properly handle dynamic pool with zero minimum size.
342
5e133e82
JB
343## [3.1.13] - 2023-12-30
344
b20bf19a
JB
345### Changed
346
347- Reduce branching in several hot code paths.
348- Use faster object cloning implementation.
349
60aa9f2f
JB
350## [3.1.12] - 2023-12-27
351
28883f84
JB
352### Fixed
353
354- Fix tasks redistribution triggers at pool destroying.
355
356### Changed
357
358- Switch TypeScript module resolution to Node16.
359
164c80dd
JB
360## [3.1.12-0] - 2023-12-27
361
f4ef37a8
JB
362### Fixed
363
364- Fix tasks redistribution triggers at pool destroying.
365
0766991a
JB
366## [3.1.11] - 2023-12-24
367
5eb72b9e
JB
368### Fixed
369
370- Avoid worker node cross tasks stealing.
371- Ensure only half the pool worker nodes can steal tasks.
372
4618ccfd
JB
373## [3.1.10] - 2023-12-23
374
09616edb
JB
375### Changed
376
377- Avoid useless branching on pool type.
378
bba20209
JB
379## [3.1.9] - 2023-12-22
380
2889bd70
JB
381### Changed
382
383- Readd ThreadPoolOptions and ClusterPoolOptions TS type aliases to PoolOptions.
384
b1bbc365
JB
385## [3.1.8] - 2023-12-21
386
ad3836ed
JB
387### Fixed
388
389- Fix default worker weight computation.
390- Fix possible null exception at pool destroying.
391
72523ab9
JB
392## [3.1.7] - 2023-12-20
393
55d7d600
JB
394### Fixed
395
396- Ensure worker choice strategies implementation wait for worker node readiness: [#1748](https://github.com/poolifier/poolifier/issues/1748).
397
165f3d56
JB
398## [3.1.6] - 2023-12-18
399
85b2561d
JB
400### Fixed
401
402- Fix pool destroying with tasks queuing enabled.
403
6c8cec9e
JB
404## [3.1.5] - 2023-12-18
405
32b141fd
JB
406### Added
407
408- Add queued tasks end timeout support to worker node termination.
409
f11ec29c
JB
410## [3.1.4] - 2023-12-18
411
4e0afe97
JB
412### Fixed
413
414- Make more robust the fix for possible null exception at handling task execution response.
415
f592ef16
JB
416## [3.1.3] - 2023-12-17
417
9b358e72
JB
418### Fixed
419
420- Fix possible null exception at handling task execution response.
421
c61772e5
JB
422## [3.1.2] - 2023-12-17
423
87347ea8
JB
424### Fixed
425
32b141fd 426- Wait for queued tasks to end at worker node termination.
87347ea8 427
6e664bec
JB
428## [3.1.1] - 2023-12-16
429
51280f9b
JB
430### Fixed
431
432- Fix pool options TS type definition.
433
5362c66b
JB
434## [3.1.0] - 2023-12-16
435
c3719753
JB
436### Changed
437
438- TypeScript breaking change: merge ThreadPoolOptions and ClusterPoolOptions types into PoolOptions type.
439
42321a2b
JB
440## [3.0.14] - 2023-12-13
441
fa548cda
JB
442### Fixed
443
444- Fix possible null exception with worker_threads pools.
445
d727d871
JB
446## [3.0.13] - 2023-12-12
447
fb5a7307
JB
448### Fixed
449
450- Ensure worker choice strategy wait for worker nodes readiness.
451
452### Changed
453
454- Remove infinite retries support in worker choice strategy to avoid configuration leading to possible infinite recursion or loop.
455
90a43710
JB
456## [3.0.12] - 2023-12-12
457
9aa78bcb
JB
458### Changed
459
460- Add infinite retries support in worker choice strategy.
45a5a54c 461
d8163b08
JB
462## [3.0.11] - 2023-12-11
463
f18fd12b
JB
464### Fixed
465
457dd3dc 466- Ensure pool asynchronous resource properly track tasks execution.
f18fd12b 467
bd453998
JB
468## [3.0.10] - 2023-12-08
469
cb71d660
JB
470### Changed
471
457dd3dc 472- Add a fastpath when tasks stealing or redistribution is impossible.
cb71d660 473
d7164344
JB
474## [3.0.9] - 2023-11-26
475
78f60f82
JB
476### Fixed
477
478- Remove all pool events listener at pool destroying.
479- Remove all worker node events listener at worker node destroying.
9f99eb9b 480- Fix worker node event emitter listeners handling memory leak at pool options runtime change.
78f60f82 481
0c08a681
JB
482## [3.0.8] - 2023-11-25
483
463226a4
JB
484### Fixed
485
457dd3dc 486- Ensure continuous tasks stealing on idle start at worker node idling.
463226a4 487
14dad1fd
JB
488## [3.0.7] - 2023-11-24
489
65542a35
JB
490### Changed
491
492- Make continuous tasks stealing start at worker node idling.
493
82c5db63
JB
494## [3.0.6] - 2023-11-24
495
711623b8
JB
496### Fixed
497
b51d8596 498- Ensure pool statuses are checked at initialization, `start()` or `destroy()`.
55082af9 499- Ensure pool `ready` event can be emitted after several `start()/destroy()` cycles.
711623b8 500
5aa31a74
JB
501## [3.0.5] - 2023-10-27
502
d91689fd
JB
503### Fixed
504
55082af9 505- Ensure pool `ready` event can be emitted only once.
d91689fd 506
597775b2
JB
507## [3.0.4] - 2023-10-20
508
03fb313b
JB
509### Changed
510
49d60f11 511- Switch to Bencher for benchmarking: [https://bencher.dev/perf/poolifier](https://bencher.dev/perf/poolifier).
03fb313b
JB
512- Use builtin retry mechanism in worker choice strategies instead of custom one.
513
6c285176
JB
514## [3.0.3] - 2023-10-19
515
9761e404
JB
516### Fixed
517
518- Avoid null exception at sending message to worker.
535fd8d5 519- Avoid null exception at checking worker node readiness.
9761e404 520
358dc40f
JB
521## [3.0.2] - 2023-10-17
522
97256a85
JB
523### Fixed
524
c3c2b35e 525- Fix race condition at dynamic worker node task assignment and scheduled removal. See issue [#1468](https://github.com/poolifier/poolifier/issues/1468) and [#1496](https://github.com/poolifier/poolifier/issues/1496).
97256a85 526
7a570743
JB
527## [3.0.1] - 2023-10-16
528
dbfa7948
JB
529### Fixed
530
fc84edac 531- Workaround possible race condition at work nodes array element removal and querying. See issue [#1468](https://github.com/poolifier/poolifier/issues/1468).
dbfa7948 532
365f13e4
JB
533### Changed
534
c3c2b35e 535- Switch the worker node eventing code to `EventTarget` API.
365f13e4 536
003b3275
JB
537## [3.0.0] - 2023-10-08
538
277c49bf
JB
539### Changed
540
541- Remove Node.js 16.x.x (EOL) support.
542
3c9e911a
JB
543## [2.7.5] - 2023-10-03
544
f80125ca
JB
545### Changed
546
547- Use `EventEmitterAsyncResource` type from `@types/node` for pool event emitter. TypeScript users will need to update to latest `@types/node` version.
548
3466e757
JB
549## [2.7.4] - 2023-09-25
550
67b26ae2
JB
551### Fixed
552
553- Fix source maps (bundler issue).
554
eeb1f961
JB
555## [2.7.3] - 2023-09-24
556
b5604034
JB
557### Changed
558
559- Convert pool event emitter to event emitter async resource.
560
f2df6dc8
JB
561## [2.7.2] - 2023-09-23
562
116ca64b
JB
563### Changed
564
565- Add source maps to npm package to ease debugging.
566
1e319a70
JB
567### Added
568
569- Continuous benchmarking versus other worker pools: [https://poolifier.github.io/benchmark](https://poolifier.github.io/benchmark).
570
aab2819b
JB
571## [2.7.1] - 2023-09-20
572
ae036c3e
JB
573### Fixed
574
575- Ensure worker message listener used one time are removed after usage.
576
15d7c489
JB
577## [2.7.0] - 2023-09-19
578
160557ff
JB
579### Fixed
580
581- Fix task stealing related tasks queue options handling at runtime.
582
c3284191
JB
583### Changed
584
585- Rename `listTaskFunctions()` to `listTaskFunctionNames()` in pool and worker API.
586
587### Added
588
35808931 589- Add `hasTaskFunction()`, `addTaskFunction()`, `removeTaskFunction()`, `setDefaultTaskFunction()` methods to pool API: [PR #1148](https://github.com/poolifier/poolifier/pull/1148).
c20084b6 590- Stricter worker constructor arguments validation.
c3284191 591
04054352
JB
592## [2.6.45] - 2023-09-17
593
093af25b
JB
594### Changed
595
596- Disable publication on GitHub packages registry on release until authentication issue is fixed.
09d9af02
JB
597
598### Added
599
ce0ab2d7 600- Add `startWorkers` to pool options to whether start the minimum number of workers at pool initialization or not.
cde5b54e 601- Add `start()` method to pool API to start the minimum number of workers.
2eee7220 602- Add `taskStealing` and `tasksStealingOnBackPressure` to tasks queue options to whether enable task stealing or not and whether enable tasks stealing under back pressure or not.
1e319a70 603- Continuous internal benchmarking: [https://poolifier.github.io/benchmark-results/dev/bench](https://poolifier.github.io/benchmark-results/dev/bench).
f1c674cd 604
bce9ffdf
JB
605## [2.6.44] - 2023-09-08
606
4cb259d3
JB
607### Fixed
608
609- Use a dedicated PAT to publish on GitHub packages registry.
610
611### Added
612
613- Publish on GitHub packages registry on release.
614
615### Changed
616
617- Switch from rome to biome: [PR #1128](https://github.com/poolifier/poolifier/pull/1128).
618
fbda1e26
JB
619## [2.6.43] - 2023-09-08
620
15fc82ba
JB
621### Added
622
4cb259d3 623- Publish on GitHub packages registry on release.
15fc82ba
JB
624
625### Changed
626
4cb259d3 627- Switch from rome to biome: [PR #1128](https://github.com/poolifier/poolifier/pull/1128).
15fc82ba 628
b47306a3
JB
629## [2.6.42] - 2023-09-06
630
ad11ca81
JB
631### Changed
632
633- Optimize hot code paths implementation: avoid unnecessary branching, add and use optimized helpers (min, max), use reduce() array helper, ...
634
1b37751d
JB
635## [2.6.41] - 2023-09-03
636
f3a91bac
JB
637### Changed
638
639- Optimize worker choice strategies implementation.
640
7790a494
JB
641## [2.6.40] - 2023-09-01
642
6fe200b4
JB
643### Fixed
644
645- Do not pre-choose in WRR worker choice strategy to avoid bias.
68738842 646- Avoid array out of bound in worker choice strategies after worker node removal.
6fe200b4 647
766c7f84
JB
648## [2.6.39] - 2023-08-30
649
edf8ce4e
JB
650### Fixed
651
4cb259d3 652- Fix race condition in worker choice strategies at worker node info querying while not yet initialized.
edf8ce4e 653
904a5689
JB
654## [2.6.38] - 2023-08-30
655
b40c4b06
JB
656### Added
657
658- Bundle typescript types declaration into one file.
659
619f403b
JB
660### Changed
661
662- Improve interleaved weighted round robin worker choice strategy implementation.
663
5a24d71c
JB
664## [2.6.37] - 2023-08-28
665
bdb9d712
JB
666### Fixed
667
668- Ensure unused worker usage statistics are deleted at runtime.
669
8c0b113f
JB
670### Changed
671
672- Rename worker choice strategy options `choiceRetries` to `retries`.
574c5c8d 673- Avoid unnecessary branching in worker choice strategies.
8c0b113f 674
ba821940
JB
675## [2.6.36] - 2023-08-27
676
9d2d0da1
JB
677### Fixed
678
679- Fix pool `execute()` arguments check.
680
1f0766e7
JB
681### Changed
682
683- Make continuous tasks stealing algorithm less aggressive.
8780236f 684- Fine tune tasks stealing algorithm under back pressure.
1f0766e7 685
ffd2c1ff
JB
686## [2.6.35] - 2023-08-25
687
dc021bcc
JB
688### Fixed
689
690- Don't account worker usage statistics for tasks that have failed.
3baa0837 691- Fix pool information runtime and wait time median computation.
dc021bcc
JB
692
693### Changed
694
695- Update simple moving average implementation to use a circular buffer.
696- Update simple moving median implementation to use a circular buffer.
68cbdc84
JB
697- Account for stolen tasks in worker usage statistics and pool information.
698
699### Added
700
701- Continuous tasks stealing algorithm.
dc021bcc 702
c58bc2a1
JB
703## [2.6.34] - 2023-08-24
704
0bc68267
JB
705### Fixes
706
707- Avoid cascading tasks stealing under back pressure.
708
709### Changed
710
711- Add fastpath to queued tasks rescheduling.
712
39fb7ad0
JB
713## [2.6.33] - 2023-08-24
714
dd951876
JB
715### Fixed
716
717- Fix queued tasks rescheduling.
718
ff3f866a
JB
719### Changed
720
721- Rename tasks queue options `queueMaxSize` to `size`.
722
a6b3272b 723### Added
dd951876 724
a6b3272b 725- Task stealing scheduling algorithm if tasks queueing is enabled.
dd951876 726
c55c9b5d
JB
727## [2.6.32] - 2023-08-23
728
15b176e0
JB
729### Fixed
730
731- Ensure no task can be executed when the pool is destroyed.
732
20c6f652
JB
733### Added
734
735- Add `queueMaxSize` option to tasks queue options.
574b351d 736- Add O(1) deque implementation implemented with doubly linked list and use it for tasks queueing.
72695f86 737- Add tasks stealing algorithm when a worker node queue is back pressured if tasks queueing is enabled.
20c6f652 738
e560a9f2
JB
739## [2.6.31] - 2023-08-20
740
b1aae695
JB
741### Fixed
742
3e8611a8 743- Fix worker choice strategy retries mechanism in some edge cases.
b1aae695 744
94407def
JB
745### Changed
746
e695d66f 747- Make orthogonal worker choice strategies tasks distribution and created dynamic worker usage.
a71b05bc 748- Remove the experimental status of the `LEAST_ELU` worker choice strategy.
94407def 749
962b9863
JB
750## [2.6.30] - 2023-08-19
751
33e6bb4c
JB
752### Fixed
753
754- Ensure pool event `backPressure` is emitted.
755- Ensure pool event `full` is emitted only once.
8735b4e5 756- Ensure worker node cannot be instantiated without proper arguments.
33e6bb4c 757
8cc4ea81
JB
758## [2.6.29] - 2023-08-18
759
6169563b
JB
760### Fixed
761
55082af9 762- Fix race condition between readiness and task functions worker message handling at startup.
5dd4043c 763- Fix duplicate task function worker usage statistics computation per task function.
db0e38ee 764- Update task function worker usage statistics if and only if there's at least two different task functions.
5bb5be17 765- Fix race condition at task function worker usage executing task computation leading to negative value.
6169563b 766
8990357d
JB
767### Added
768
445264e8 769- 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
770- Use back pressure detection in worker choice strategies.
771- Add worker choice strategies retries mechanism if no worker is eligible.
772
21157987
JB
773## [2.6.28] - 2023-08-16
774
f05ed93c
JB
775### Fixed
776
777- Ensure pool workers are properly initialized.
778
12d67776
JB
779### Added
780
781- HTTP server pool examples: express-cluster, express-hybrid.
782
d18fccb1
JB
783### Changed
784
785- Remove now useless branching in worker hot code path.
786
741cdb34
JB
787## [2.6.27] - 2023-08-15
788
50e7f498
JB
789### Fixed
790
791- Add `KillHandler` type definition to exported types.
792
ef3891a3
JB
793### Added
794
795- Add `destroy` event to pool API.
796
e9dc6efa
JB
797## [2.6.26] - 2023-08-15
798
2b099bf7
JB
799### Added
800
801- Add kill handler to worker options allowing to execute custom code when worker is killed.
ef3891a3 802- Add `listTaskFunctions()` method to pool API.
1f4553c6 803- SMTP client pool example: nodemailer.
2b099bf7 804
5b726f72
JB
805## [2.6.25] - 2023-08-13
806
72855e92
JB
807### Added
808
3b311539 809- HTTP server pool examples: fastify-cluster, fastify-hybrid.
02999424 810- WebSocket server pool examples: ws-cluster, ws-hybrid.
72855e92 811
7aadd6e5
JB
812## [2.6.24] - 2023-08-12
813
7d91a8cd
JB
814### Added
815
816- Add array of transferable objects to the `execute()` method arguments.
02999424 817- WebSocket server pool examples: ws-worker_threads.
7d91a8cd 818
6b4263b4
JB
819## [2.6.23] - 2023-08-11
820
3d76750a 821### Fixed
8e0af894 822
3d76750a 823- 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 824
3d76750a
JB
825### Added
826
827- HTTP client pool examples: fetch, node-fetch and axios with multiple task functions.
02999424 828- HTTP server pool examples: express-worker_threads, fastify-worker_threads.
3d76750a
JB
829
830## [2.6.22] - 2023-08-10
9606b474 831
3d76750a 832### Fixed
9606b474
JB
833
834- Add missing `types` field to package.json `exports`.
835
3d76750a
JB
836### Changed
837
838- Structure markdown documentation (PR #811).
839
d9647bdd
JB
840## [2.6.21] - 2023-08-03
841
2111ec12
JB
842### Changed
843
844- Improve code documentation.
845- Code refactoring and cleanup for better maintainability and readability.
846
5c30b9d9
JB
847## [2.6.20] - 2023-07-21
848
10ecf8fd
JB
849### Fixed
850
851- Fix queued tasks redistribution on error task execution starvation.
a1763c54 852- Ensure tasks queueing per worker condition is untangled from the pool busyness semantic.
10ecf8fd 853
aa9eede8
JB
854### Changed
855
7c89e6a4 856- Drastically reduce lookups by worker in the worker nodes.
aa9eede8 857
62485908
JB
858## [2.6.19] - 2023-07-20
859
2e2ef9c3
JB
860### Added
861
862- Dedicated internal communication channel for worker_threads pools.
863
8f4c9491
JB
864## [2.6.18] - 2023-07-19
865
8660b972
JB
866### Changed
867
868- Code refactoring and cleanup for better maintainability and readability. Bundle size is a bit smaller.
869
206a3519
JB
870## [2.6.17] - 2023-07-16
871
b4899fae
JB
872### Added
873
1a3e01ba 874- Add `listTaskFunctions()` method to worker API.
b4899fae 875
58a06a6c
JB
876## [2.6.16] - 2023-07-12
877
2a69b8c5
JB
878### Fixed
879
80520ca4 880- Fix pool startup detection.
2a69b8c5
JB
881- Fix worker task functions handling.
882
b5900b02
JB
883## [2.6.15] - 2023-07-11
884
19dbc45b
JB
885### Added
886
887- Take into account worker node readiness in worker choice strategies.
888
4a0db581
JB
889## [2.6.14] - 2023-07-10
890
87e44747
JB
891### Fixed
892
893- Fix task function statistics tracking.
894
0265272f
JB
895## [2.6.13] - 2023-07-10
896
968a2e8c
JB
897### Added
898
899- Add per task function statistics tracking.
782299f8 900- Add public methods to manipulate the worker task functions at runtime.
968a2e8c 901
44c8c00f
JB
902## [2.6.12] - 2023-07-09
903
aa4bf4b2
JB
904### Fixed
905
906- Workaround import issue with `node:os` module in node 16.x.x.
907
b7cfced1
JB
908## [2.6.11] - 2023-07-09
909
d5024c00
JB
910### Fixed
911
912- Fix pool readiness semantic.
913
f313a208
JB
914## [2.6.10] - 2023-07-08
915
2431bdb4
JB
916### Fixed
917
918- Ensure workers are not recreated on error at pool startup.
919
920### Added
921
922- Add `ready` and `strategy` fields to pool information.
923- 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 924- Add dynamic pool sizing checks.
2431bdb4 925
369d0a51
JB
926## [2.6.9] - 2023-07-07
927
2845f2a5
JB
928### Fixed
929
930- Recreate the right worker type on uncaught exception.
931
932### Added
933
934- Add minimum and maximum to internal measurement statistics.
1dcf8b7b 935- Add `runTime` and `waitTime` to pool information.
75d3401a 936- Check worker inactive time only on dynamic worker.
2845f2a5 937
fc97d613
JB
938## [2.6.8] - 2023-07-03
939
92b1feaa
JB
940### Fixed
941
942- Brown paper bag release to fix version handling in pool information.
943
52d54060
JB
944## [2.6.7] - 2023-07-03
945
5bc91f3e
JB
946### Fixed
947
948- Ensure worker queued tasks at error are reassigned to other pool workers.
949
afe0d5bf
JB
950### Added
951
952- Add pool `utilization` ratio to pool information.
23ccf9d7 953- Add `version` to pool information.
e5b3047d 954- Add worker information to worker nodes.
afe0d5bf 955
f42c583f
JB
956## [2.6.6] - 2023-07-01
957
6961ca9a
JB
958### Added
959
d5e3c4ff 960- Add safe helper `availableParallelism()` to help sizing the pool.
6961ca9a 961
3749facb
JB
962### Fixed
963
964- Ensure message handler is only registered in worker.
965
6fed2513
JB
966## [2.6.5] - 2023-06-27
967
c72f6987
JB
968### Known issues
969
70726c28 970- Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
c72f6987
JB
971
972### Fixed
973
974- Artificial version bump to 2.6.5 to workaround publication issue.
d5e3c4ff 975- Ensure cluster pool `destroy()` gracefully shutdowns worker's server.
c72f6987
JB
976- Ensure pool event is emitted before task error promise rejection.
977- Fix queued tasks count computation.
978
979### Removed
980
2fbe1783 981- Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
c72f6987 982
6426631b
JB
983## [2.6.4] - 2023-06-27
984
941f9a7c
JB
985### Known issues
986
70726c28 987- Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
941f9a7c 988
2c039e43
JB
989### Fixed
990
d5e3c4ff 991- Ensure cluster pool `destroy()` gracefully shutdowns worker's server.
2c039e43 992- Ensure pool event is emitted before task error promise rejection.
9c16fb4b 993- Fix queued tasks count computation.
2c039e43 994
941f9a7c
JB
995### Removed
996
2fbe1783 997- Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
941f9a7c 998
bc1b0765
JB
999## [2.6.3] - 2023-06-19
1000
a6a2dc4c
JB
1001### Fixed
1002
1003- Ensure no tasks are queued when trying to soft kill a dynamic worker.
f0d7f803 1004- Update strategies internals after statistics computation.
a6a2dc4c 1005
7b56f532
JB
1006### Changed
1007
1008- Optimize O(1) queue implementation.
1009
b628596c
JB
1010## [2.6.2] - 2023-06-12
1011
a9e89d00
JB
1012### Fixed
1013
1014- Fix new worker use after creation in dynamic pool given the current worker choice strategy.
1015
4368a898
JB
1016## [2.6.1] - 2023-06-10
1017
931d43e2
JB
1018### Added
1019
13ab5b87 1020- Add worker choice strategy documentation: [README.md](./docs/worker-choice-strategies.md).
931d43e2 1021
f1c06930
JB
1022### Fixed
1023
1024- Fix average statistics computation: ensure failed tasks are not accounted.
1025
16671b07
JB
1026## [2.6.0] - 2023-06-09
1027
a1347286
JB
1028### Added
1029
5af9c0f7 1030- Add `LEAST_ELU` worker choice strategy (experimental).
9adcefab 1031- Add tasks ELU instead of runtime support to `FAIR_SHARE` worker choice strategy.
a1347286 1032
1c6fe997
JB
1033### Changed
1034
1035- Refactor pool worker node usage internals.
477f48e7 1036- Breaking change: refactor worker choice strategy statistics requirements: the syntax of the worker choice strategy options has changed.
f63a9dda 1037- Breaking change: pool information `info` property object fields have been renamed.
1c6fe997
JB
1038
1039### Fixed
1040
1041- Fix wait time accounting.
1042- Ensure worker choice strategy `LEAST_BUSY` accounts also tasks wait time.
1043- Ensure worker choice strategy `LEAST_USED` accounts also queued tasks.
1044
aa07d6ee
JB
1045## [2.5.4] - 2023-06-07
1046
b6b32453
JB
1047### Added
1048
1049- Add Event Loop Utilization (ELU) statistics to worker tasks usage.
1050
1051### Changed
1052
1053- Compute statistics at the worker level only if needed.
2fbe1783 1054- Add `worker_threads` options to thread pool options.
b6b32453 1055
272d4d8f
JB
1056### Fixed
1057
1058- Make the `LEAST_BUSY` strategy only relies on task runtime.
1059
ed47fb3d
JB
1060## [2.5.3] - 2023-06-04
1061
89a4abfd
JB
1062### Changed
1063
1064- Refine pool information content.
b4213b7f 1065- Limit pool internals public exposure.
89a4abfd 1066
8a9febf5
JB
1067## [2.5.2] - 2023-06-02
1068
91ee39ed
JB
1069### Added
1070
1071- Add `taskError` pool event for task execution error.
6b27d407 1072- Add pool information `info` property to pool.
91ee39ed
JB
1073- Emit pool information on `busy` and `full` pool events.
1074
8babb151
JB
1075## [2.5.1] - 2023-06-01
1076
0e05c4dc
JB
1077### Added
1078
1f68cede 1079- Add pool option `restartWorkerOnError` to restart worker on uncaught error. Default to `true`.
91ee39ed 1080- Add `error` pool event for uncaught worker error.
0e05c4dc 1081
a8766181
JB
1082## [2.5.0] - 2023-05-31
1083
e4543b14
JB
1084### Added
1085
1086- Switch pool event emitter to `EventEmitterAsyncResource`.
6da80d38 1087- Add tasks wait time accounting in per worker tasks usage.
5af9c0f7 1088- Add interleaved weighted round robin `INTERLEAVED_WEIGHTED_ROUND_ROBIN` worker choice strategy (experimental).
e4543b14
JB
1089
1090### Changed
1091
1092- Renamed worker choice strategy `LESS_BUSY` to `LEAST_BUSY` and `LESS_USED` to `LEAST_USED`.
1093
570efb11
JB
1094## [2.4.14] - 2023-05-09
1095
b0f28bad
JB
1096### Fixed
1097
1098- Ensure no undefined task runtime can land in the tasks history.
1099- Fix median computation implementation once again.
1100
110b6d13
JB
1101### Added
1102
1103- Unit tests for median and queue implementations.
1104
72584880
JB
1105## [2.4.13] - 2023-05-08
1106
b0d6ed8f
JB
1107### Fixed
1108
e3058615 1109- Fix worker choice strategy options validation.
b0d6ed8f
JB
1110- Fix fair share worker choice strategy internals update: ensure virtual task end timestamp is computed at task submission.
1111
06140c32
JB
1112## [2.4.12] - 2023-05-06
1113
a86b6df1
JB
1114### Added
1115
1116- Support multiple task functions per worker.
08f3f44c 1117- Add custom worker weights support to worker choice strategies options.
a86b6df1 1118
29ee7e9a
JB
1119### Changed
1120
1121- Use O(1) queue implementation for tasks queueing.
1122
0682ba15
JB
1123### Fixed
1124
1125- Fix median computation implementation.
1126- Fix fair share worker choice strategy internals update.
1127
936d53ec
JB
1128## [2.4.11] - 2023-04-23
1129
cb70b19d
JB
1130### Changed
1131
1132- Optimize free worker finding in worker choice strategies.
1133
15bb637a
JB
1134## [2.4.10] - 2023-04-15
1135
ef41a6e6
JB
1136### Fixed
1137
82ea6492 1138- Fix typescript type definition for task function: ensure the input data is optional.
ef41a6e6
JB
1139- Fix typescript type definition for pool execute(): ensure the input data is optional.
1140
181eb2b4
JB
1141## [2.4.9] - 2023-04-15
1142
a20f0ba5
JB
1143### Added
1144
1145- Add tasks queue enablement runtime setter to pool.
1146- Add tasks queue options runtime setter to pool.
1147- Add worker choice strategy options runtime setter to pool.
1148
1149### Changed
1150
1151- Remove the tasks queuing experimental status.
1152
d4aeae5a
JB
1153### Fixed
1154
82ea6492 1155- Fix task function type definition and validation.
2fc5cae3 1156- Fix worker choice strategy options handling.
d4aeae5a 1157
1d9e7023
JB
1158## [2.4.8] - 2023-04-12
1159
f9b4bbf8
JB
1160### Fixed
1161
1162- Fix message between main worker and worker type definition for tasks.
1163- Fix code documentation.
1164
12ae3210
JB
1165## [2.4.7] - 2023-04-11
1166
7171d33f
JB
1167### Added
1168
1169- Add worker tasks queue options to pool options.
1170
e8bd29ce
JB
1171### Fixed
1172
1173- Fix missing documentation.
1174
42c7bc10
JB
1175## [2.4.6] - 2023-04-10
1176
681196cc
JB
1177### Fixed
1178
1179- Ensure one task at a time is executed per worker with tasks queueing enabled.
1c6fe997 1180- Properly count worker executing tasks with tasks queueing enabled.
681196cc 1181
54d360e3
JB
1182## [2.4.5] - 2023-04-09
1183
3fafb1b2
JB
1184### Added
1185
9e775f96
JB
1186- Use monotonic high resolution timer for worker tasks runtime.
1187- Add worker tasks median runtime to statistics.
ff733df7 1188- Add worker tasks queue (experimental).
3fafb1b2 1189
92fa3eb6
JB
1190## [2.4.4] - 2023-04-07
1191
aee46736
JB
1192### Added
1193
1194- Add `PoolEvents` enumeration and `PoolEvent` type.
1195
36b5e78f
JB
1196### Fixed
1197
ff0c2b3e 1198- Destroy worker only on alive check.
36b5e78f 1199
9fb0f324
JB
1200## [2.4.3] - 2023-04-07
1201
28cf3617
JB
1202### Fixed
1203
1204- Fix typedoc generation with inheritance.
1205
848f0f27
JB
1206## [2.4.2] - 2023-04-06
1207
164d950a
JB
1208### Added
1209
1210- Add `full` event to dynamic pool.
32417142 1211- Keep worker choice strategy in memory for conditional reuse.
164d950a 1212
78ab2555
JB
1213### Fixed
1214
1215- Fix possible negative worker key at worker removal in worker choice strategies.
1216
79aafe9f
JB
1217## [2.4.1] - 2023-04-05
1218
9cd39dd4
JB
1219### Changed
1220
1221- Optimize worker choice strategy for dynamic pool.
1222
965415bb
JB
1223### Fixed
1224
1225- Ensure dynamic pool does not alter worker choice strategy expected behavior.
1226
d8b60b1c
JB
1227## [2.4.0] - 2023-04-04
1228
c6bd2650
JB
1229### Added
1230
1231- Add `LESS_BUSY` worker choice strategy.
1232
1233### Changed
1234
1235- Optimize worker storage in pool.
1236- Optimize worker alive status check.
1237- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
1238- Optimize `LESS_USED` worker choice strategy.
2a87030e 1239- Update benchmark versus external threads pools.
c6bd2650
JB
1240- Optimize tasks usage statistics requirements for worker choice strategy.
1241
1242### Fixed
1243
1244- Ensure trimmable characters are checked at pool initialization.
1245- Fix message id integer overflow.
1246- Fix pool worker removal in worker choice strategy internals.
1247- Fix package publication with pnpm.
1248
d0a3f018
JB
1249## [2.4.0-3] - 2023-04-04
1250
b2ede285
JB
1251### Added
1252
1253- Add `LESS_BUSY` worker choice strategy.
1254
1255### Changed
1256
1257- Optimize worker storage in pool.
1258- Optimize worker alive status check.
1259- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
1260- Optimize `LESS_USED` worker choice strategy.
2a87030e 1261- Update benchmark versus external threads pools.
b2ede285
JB
1262
1263### Fixed
1264
1265- Ensure trimmable characters are checked at pool initialization.
1266- Fix message id integer overflow.
1267- Fix pool worker removal in worker choice strategy internals.
1268- Fix package publication with pnpm.
1269
a015ea40
JB
1270## [2.4.0-2] - 2023-04-03
1271
698f4bbc
JB
1272### Added
1273
1274- Add `LESS_BUSY` worker choice strategy.
1275
1276### Changed
1277
1278- Optimize worker storage in pool.
1279- Optimize worker alive status check.
1280- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
1281- Optimize `LESS_USED` worker choice strategy.
1282
1283### Fixed
1284
1285- Ensure trimmable characters are checked at pool initialization.
1286- Fix message id integer overflow.
1287- Fix pool worker removal in worker choice strategy internals.
1288- Fix package publication with pnpm.
1289
8fe15920
JB
1290## [2.4.0-1] - 2023-04-03
1291
5b301c28
JB
1292### Added
1293
1294- Add `LESS_BUSY` worker choice strategy.
1295
1296### Changed
1297
1298- Optimize worker storage in pool.
1299- Optimize worker alive status check.
1300- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
1301- Optimize `LESS_USED` worker choice strategy.
1302
1303### Fixed
1304
1305- Ensure trimmable characters are checked at pool initialization.
1306- Fix message id integer overflow.
1307- Fix pool worker removal in worker choice strategy internals.
1308
2fb9ca9c
JB
1309## [2.4.0-0] - 2023-04-03
1310
168c526f
JB
1311### Added
1312
1313- Add `LESS_BUSY` worker choice strategy.
1314
1d71a908
JB
1315### Changed
1316
ffcbbad8 1317- Optimize worker storage in pool.
1d71a908 1318- Optimize worker alive status check.
65a60b3b 1319- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
737c6d97 1320- Optimize `LESS_USED` worker choice strategy.
1d71a908 1321
ffcbbad8
JB
1322### Fixed
1323
1324- Ensure trimmable characters are checked at pool initialization.
b4e75778 1325- Fix message id integer overflow.
97a2abc3 1326- Fix pool worker removal in worker choice strategy internals.
ffcbbad8 1327
08372738
JB
1328## [2.3.10] - 2023-03-18
1329
710826bc
JB
1330### Fixed
1331
9606b474 1332- Fix package.json `exports` syntax for ESM and CommonJS.
710826bc
JB
1333
1334### Changed
1335
1336- Permit SemVer pre-release publication.
76e5ac6f 1337
e4796ecd
JB
1338## [2.3.10-2] - 2023-03-18
1339
6abad580
JB
1340### Fixed
1341
9606b474 1342- Fix package.json `exports` syntax for ESM and CommonJS.
6abad580 1343
a2ee98cc
JB
1344## [2.3.10-1] - 2023-03-18
1345
7e060cee
JB
1346### Changed
1347
90483887 1348- Permit SemVer pre-release publication.
7e060cee 1349
c81bfafb
JB
1350## [2.3.10-0] - 2023-03-18
1351
fe18768d
JB
1352### Fixed
1353
9606b474 1354- Fix package.json `exports` syntax for ESM and CommonJS.
fe18768d 1355
d7b78217
JB
1356## [2.3.9] - 2023-03-18
1357
ed6dd37f
JB
1358### Changed
1359
1360- Introduce ESM module support along with CommonJS one.
1361
1362### Fixed
1363
1364- Fix brown paper bag bug referencing the same object literal.
1365
68e2ad86
JB
1366## [2.3.8] - 2023-03-18
1367
ca6c7d70
JB
1368### Changed
1369
1370- Switch internal benchmarking code to benny.
fbdedeb9
JB
1371- Switch to TypeScript 5.x.x.
1372- Switch rollup bundler plugins to core ones.
ed6dd37f 1373- Switch to TSDoc syntax.
fbdedeb9 1374- Enforce conventional commits.
ca6c7d70 1375
d15211d4
JB
1376### Fixed
1377
1378- Fix random integer generator.
fbdedeb9 1379- Fix worker choice strategy pool type identification at initialization.
d15211d4 1380
995705ea
JB
1381## [2.3.7] - 2022-10-23
1382
b953022b
JB
1383### Changed
1384
1385- Switch to open collective FOSS project funding platform.
78cea37e
JB
1386- Switch to ts-standard linter configuration on TypeScript code.
1387
1388### Fixed
1389
1390- Fixed missing async on pool execute method.
1391- Fixed typing in TypeScript example.
1392- Fixed types in unit tests.
b953022b 1393
3b9f6953
JB
1394## [2.3.6] - 2022-10-22
1395
f80cead4
JB
1396### Changed
1397
1398- Cleanup pool attributes and methods.
1399- Refine error types thrown.
1400
1401### Fixed
1402
1403- Fix continuous integration build on windows.
1404- Fix code coverage reporting by using c8 instead of nyc.
1405
efc22107
JB
1406## [2.3.5] - 2022-10-21
1407
7a6a0a96
JB
1408### Changed
1409
a05c10de
JB
1410- Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
1411- Optimize tasks usage lookup implementation.
7a6a0a96 1412
b4904890
JB
1413### Fixed
1414
1415- Fix missed pool event emitter type export.
1416- Fix typedoc documentation generation.
1417
a875f8d1
JB
1418## [2.3.4] - 2022-10-17
1419
73cda448
JB
1420### Added
1421
1422- Fully automate release process with release-it.
1423
45a5a54c
JB
1424### Changed
1425
73cda448 1426- Optimize fair share task scheduling algorithm implementation.
2a87030e 1427- Update benchmark versus external pools results with latest version.
45a5a54c 1428
90ee1b18 1429## [2.3.3] - 2022-10-15
1a76932b
JB
1430
1431### Added
1432
1433- Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
1434
90ee1b18 1435## [2.3.2] - 2022-10-14
11df3590
JB
1436
1437### Changed
1438
1439- Optimize fair share worker selection strategy implementation.
1440
1441### Fixed
1442
1443- Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
1444
90ee1b18 1445## [2.3.1] - 2022-10-13
23ff945a
JB
1446
1447### Added
1448
1449- Pool worker choice strategies:
1450 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
1451 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
1452
90ee1b18 1453## [2.2.2] - 2022-10-09
cb2b6c69
JB
1454
1455### Fixed
1456
1457- Fixed `README.md` file.
1458
90ee1b18 1459## [2.2.1] - 2022-10-08
bdacc2d2 1460
bdaf31cd
JB
1461### Added
1462
1463- Dynamic worker choice strategy change at runtime.
bdacc2d2 1464
90ee1b18 1465## [2.2.0] - 2022-01-05
7e0d447f
JB
1466
1467### Breaking Changes
1468
9606b474 1469- Support only Node.js version 16.x.x for cluster pool: upstream cluster API have changed on that version.
7e0d447f 1470
90ee1b18 1471## [2.1.0] - 2021-08-29
35cf1c03
JB
1472
1473### Added
1474
1475- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
e088a00c
JB
1476
1477### Breaking Changes
1478
1479- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
1480- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
1481- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
c365b2d3 1482- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
e088a00c 1483
90ee1b18 1484## [2.0.2] - 2021-05-12
14916bf9
JB
1485
1486### Bug fixes
1487
1488- Fix `busy` event emission on fixed pool type
1489
90ee1b18 1490## [2.0.1] - 2021-03-16
7f685093
JB
1491
1492### Bug fixes
1493
1494- Check if pool options are properly set.
1495- `busy` event is emitted on all pool types.
1496
90ee1b18 1497## [2.0.0] - 2021-03-01
fa0f5b28 1498
f3f833ab 1499### Bug fixes
d63d3be3 1500
ddbeaffd 1501- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
d63d3be3 1502
fa0f5b28
S
1503### Breaking Changes
1504
7f685093 1505- `FullPool` event is now renamed to `busy`.
1927ee67 1506- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
1a81f8af 1507 _Find more details on our JSDoc._
ddbeaffd 1508
1927ee67
APA
1509- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
1510
ddbeaffd 1511- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
fa0f5b28 1512
ec2ccfc8
JB
1513### Pool options types declaration merge
1514
1515`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
1516
fa0f5b28
S
1517#### New `export` strategy
1518
1519```js
1520// Before
0eee77cb 1521const DynamicThreadPool = require('poolifier/lib/dynamic')
fa0f5b28 1522// After
0eee77cb 1523const { DynamicThreadPool } = require('poolifier/lib/dynamic')
fa0f5b28
S
1524```
1525
1526But you should always prefer just using
1527
1528```js
0eee77cb 1529const { DynamicThreadPool } = require('poolifier')
fa0f5b28
S
1530```
1531
d3c8a1a8
S
1532#### New type definitions for input data and response
1533
6677a3d3 1534For cluster worker and worker-thread pools, you can now only send and receive structured-cloneable data.
9606b474 1535_This is not a limitation by poolifier but Node.js._
d3c8a1a8 1536
3a4b605f 1537#### Public property replacements
5c5a1fb7 1538
3a4b605f 1539`numWorkers` property is now `numberOfWorkers`
5c5a1fb7 1540
280c2a77 1541#### Internal (protected) properties and methods renaming
fa0f5b28 1542
280c2a77
S
1543These properties are not intended for end users
1544
1545- `id` => `nextMessageId`
1546
1547These methods are not intended for end users
fa0f5b28
S
1548
1549- `_chooseWorker` => `chooseWorker`
280c2a77 1550- `_newWorker` => `createWorker`
fa0f5b28
S
1551- `_execute` => `internalExecute`
1552- `_chooseWorker` => `chooseWorker`
1553- `_checkAlive` => `checkAlive`
1554- `_run` => `run`
1555- `_runAsync` => `runAsync`
1556
90ee1b18 1557## [1.1.0] - 2020-05-21
0312f71a
APA
1558
1559### Added
1560
1561- ThreadWorker support async functions as option
cf9aa6c3 1562- Various external library patches
0312f71a 1563
90ee1b18 1564## [1.0.0] - 2020-01-24
522eea03 1565
1566### Added
1567
1568- FixedThreadPool implementation
1569- DynamicThreadPool implementation
0312f71a 1570- WorkerThread implementation to improve developer experience