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