Commit | Line | Data |
---|---|---|
522eea03 | 1 | # Changelog |
2 | ||
3 | All notable changes to this project will be documented in this file. | |
4 | ||
d4abc60a | 5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), |
522eea03 | 6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
7 | ||
45a5a54c JB |
8 | ## [Unreleased] |
9 | ||
681196cc JB |
10 | ### Fixed |
11 | ||
12 | - Ensure one task at a time is executed per worker with tasks queueing enabled. | |
13 | ||
54d360e3 JB |
14 | ## [2.4.5] - 2023-04-09 |
15 | ||
3fafb1b2 JB |
16 | ### Added |
17 | ||
18 | - Use monotonic high resolution timer for worker tasks run time. | |
19 | - Add worker tasks median run time to statistics. | |
ff733df7 | 20 | - Add worker tasks queue (experimental). |
3fafb1b2 | 21 | |
92fa3eb6 JB |
22 | ## [2.4.4] - 2023-04-07 |
23 | ||
aee46736 JB |
24 | ### Added |
25 | ||
26 | - Add `PoolEvents` enumeration and `PoolEvent` type. | |
27 | ||
36b5e78f JB |
28 | ### Fixed |
29 | ||
ff0c2b3e | 30 | - Destroy worker only on alive check. |
36b5e78f | 31 | |
9fb0f324 JB |
32 | ## [2.4.3] - 2023-04-07 |
33 | ||
28cf3617 JB |
34 | ### Fixed |
35 | ||
36 | - Fix typedoc generation with inheritance. | |
37 | ||
848f0f27 JB |
38 | ## [2.4.2] - 2023-04-06 |
39 | ||
164d950a JB |
40 | ### Added |
41 | ||
42 | - Add `full` event to dynamic pool. | |
32417142 | 43 | - Keep worker choice strategy in memory for conditional reuse. |
164d950a | 44 | |
78ab2555 JB |
45 | ### Fixed |
46 | ||
47 | - Fix possible negative worker key at worker removal in worker choice strategies. | |
48 | ||
79aafe9f JB |
49 | ## [2.4.1] - 2023-04-05 |
50 | ||
9cd39dd4 JB |
51 | ### Changed |
52 | ||
53 | - Optimize worker choice strategy for dynamic pool. | |
54 | ||
965415bb JB |
55 | ### Fixed |
56 | ||
57 | - Ensure dynamic pool does not alter worker choice strategy expected behavior. | |
58 | ||
d8b60b1c JB |
59 | ## [2.4.0] - 2023-04-04 |
60 | ||
c6bd2650 JB |
61 | ### Added |
62 | ||
63 | - Add `LESS_BUSY` worker choice strategy. | |
64 | ||
65 | ### Changed | |
66 | ||
67 | - Optimize worker storage in pool. | |
68 | - Optimize worker alive status check. | |
69 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
70 | - Optimize `LESS_USED` worker choice strategy. | |
71 | - Update benchmarks versus external threads pools. | |
72 | - Optimize tasks usage statistics requirements for worker choice strategy. | |
73 | ||
74 | ### Fixed | |
75 | ||
76 | - Ensure trimmable characters are checked at pool initialization. | |
77 | - Fix message id integer overflow. | |
78 | - Fix pool worker removal in worker choice strategy internals. | |
79 | - Fix package publication with pnpm. | |
80 | ||
d0a3f018 JB |
81 | ## [2.4.0-3] - 2023-04-04 |
82 | ||
b2ede285 JB |
83 | ### Added |
84 | ||
85 | - Add `LESS_BUSY` worker choice strategy. | |
86 | ||
87 | ### Changed | |
88 | ||
89 | - Optimize worker storage in pool. | |
90 | - Optimize worker alive status check. | |
91 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
92 | - Optimize `LESS_USED` worker choice strategy. | |
93 | - Update benchmarks versus external threads pools. | |
94 | ||
95 | ### Fixed | |
96 | ||
97 | - Ensure trimmable characters are checked at pool initialization. | |
98 | - Fix message id integer overflow. | |
99 | - Fix pool worker removal in worker choice strategy internals. | |
100 | - Fix package publication with pnpm. | |
101 | ||
a015ea40 JB |
102 | ## [2.4.0-2] - 2023-04-03 |
103 | ||
698f4bbc JB |
104 | ### Added |
105 | ||
106 | - Add `LESS_BUSY` worker choice strategy. | |
107 | ||
108 | ### Changed | |
109 | ||
110 | - Optimize worker storage in pool. | |
111 | - Optimize worker alive status check. | |
112 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
113 | - Optimize `LESS_USED` worker choice strategy. | |
114 | ||
115 | ### Fixed | |
116 | ||
117 | - Ensure trimmable characters are checked at pool initialization. | |
118 | - Fix message id integer overflow. | |
119 | - Fix pool worker removal in worker choice strategy internals. | |
120 | - Fix package publication with pnpm. | |
121 | ||
8fe15920 JB |
122 | ## [2.4.0-1] - 2023-04-03 |
123 | ||
5b301c28 JB |
124 | ### Added |
125 | ||
126 | - Add `LESS_BUSY` worker choice strategy. | |
127 | ||
128 | ### Changed | |
129 | ||
130 | - Optimize worker storage in pool. | |
131 | - Optimize worker alive status check. | |
132 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. | |
133 | - Optimize `LESS_USED` worker choice strategy. | |
134 | ||
135 | ### Fixed | |
136 | ||
137 | - Ensure trimmable characters are checked at pool initialization. | |
138 | - Fix message id integer overflow. | |
139 | - Fix pool worker removal in worker choice strategy internals. | |
140 | ||
2fb9ca9c JB |
141 | ## [2.4.0-0] - 2023-04-03 |
142 | ||
168c526f JB |
143 | ### Added |
144 | ||
145 | - Add `LESS_BUSY` worker choice strategy. | |
146 | ||
1d71a908 JB |
147 | ### Changed |
148 | ||
ffcbbad8 | 149 | - Optimize worker storage in pool. |
1d71a908 | 150 | - Optimize worker alive status check. |
65a60b3b | 151 | - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`. |
737c6d97 | 152 | - Optimize `LESS_USED` worker choice strategy. |
1d71a908 | 153 | |
ffcbbad8 JB |
154 | ### Fixed |
155 | ||
156 | - Ensure trimmable characters are checked at pool initialization. | |
b4e75778 | 157 | - Fix message id integer overflow. |
97a2abc3 | 158 | - Fix pool worker removal in worker choice strategy internals. |
ffcbbad8 | 159 | |
08372738 JB |
160 | ## [2.3.10] - 2023-03-18 |
161 | ||
710826bc JB |
162 | ### Fixed |
163 | ||
164 | - Fix `exports` syntax for ESM and CommonJS. | |
165 | ||
166 | ### Changed | |
167 | ||
168 | - Permit SemVer pre-release publication. | |
76e5ac6f | 169 | |
e4796ecd JB |
170 | ## [2.3.10-2] - 2023-03-18 |
171 | ||
6abad580 JB |
172 | ### Fixed |
173 | ||
174 | - Fix `exports` syntax for ESM and CommonJS. | |
175 | ||
a2ee98cc JB |
176 | ## [2.3.10-1] - 2023-03-18 |
177 | ||
7e060cee JB |
178 | ### Changed |
179 | ||
90483887 | 180 | - Permit SemVer pre-release publication. |
7e060cee | 181 | |
c81bfafb JB |
182 | ## [2.3.10-0] - 2023-03-18 |
183 | ||
fe18768d JB |
184 | ### Fixed |
185 | ||
186 | - Fix `exports` syntax for ESM and CommonJS. | |
187 | ||
d7b78217 JB |
188 | ## [2.3.9] - 2023-03-18 |
189 | ||
ed6dd37f JB |
190 | ### Changed |
191 | ||
192 | - Introduce ESM module support along with CommonJS one. | |
193 | ||
194 | ### Fixed | |
195 | ||
196 | - Fix brown paper bag bug referencing the same object literal. | |
197 | ||
68e2ad86 JB |
198 | ## [2.3.8] - 2023-03-18 |
199 | ||
ca6c7d70 JB |
200 | ### Changed |
201 | ||
202 | - Switch internal benchmarking code to benny. | |
fbdedeb9 JB |
203 | - Switch to TypeScript 5.x.x. |
204 | - Switch rollup bundler plugins to core ones. | |
ed6dd37f | 205 | - Switch to TSDoc syntax. |
fbdedeb9 | 206 | - Enforce conventional commits. |
ca6c7d70 | 207 | |
d15211d4 JB |
208 | ### Fixed |
209 | ||
210 | - Fix random integer generator. | |
fbdedeb9 | 211 | - Fix worker choice strategy pool type identification at initialization. |
d15211d4 | 212 | |
995705ea JB |
213 | ## [2.3.7] - 2022-10-23 |
214 | ||
b953022b JB |
215 | ### Changed |
216 | ||
217 | - Switch to open collective FOSS project funding platform. | |
78cea37e JB |
218 | - Switch to ts-standard linter configuration on TypeScript code. |
219 | ||
220 | ### Fixed | |
221 | ||
222 | - Fixed missing async on pool execute method. | |
223 | - Fixed typing in TypeScript example. | |
224 | - Fixed types in unit tests. | |
b953022b | 225 | |
3b9f6953 JB |
226 | ## [2.3.6] - 2022-10-22 |
227 | ||
f80cead4 JB |
228 | ### Changed |
229 | ||
230 | - Cleanup pool attributes and methods. | |
231 | - Refine error types thrown. | |
232 | ||
233 | ### Fixed | |
234 | ||
235 | - Fix continuous integration build on windows. | |
236 | - Fix code coverage reporting by using c8 instead of nyc. | |
237 | ||
efc22107 JB |
238 | ## [2.3.5] - 2022-10-21 |
239 | ||
7a6a0a96 JB |
240 | ### Changed |
241 | ||
a05c10de JB |
242 | - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter. |
243 | - Optimize tasks usage lookup implementation. | |
7a6a0a96 | 244 | |
b4904890 JB |
245 | ### Fixed |
246 | ||
247 | - Fix missed pool event emitter type export. | |
248 | - Fix typedoc documentation generation. | |
249 | ||
a875f8d1 JB |
250 | ## [2.3.4] - 2022-10-17 |
251 | ||
73cda448 JB |
252 | ### Added |
253 | ||
254 | - Fully automate release process with release-it. | |
255 | ||
45a5a54c JB |
256 | ### Changed |
257 | ||
73cda448 | 258 | - Optimize fair share task scheduling algorithm implementation. |
eb4a8a82 | 259 | - Update benchmarks versus external pools results with latest version. |
45a5a54c | 260 | |
90ee1b18 | 261 | ## [2.3.3] - 2022-10-15 |
1a76932b JB |
262 | |
263 | ### Added | |
264 | ||
265 | - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options. | |
266 | ||
90ee1b18 | 267 | ## [2.3.2] - 2022-10-14 |
11df3590 JB |
268 | |
269 | ### Changed | |
270 | ||
271 | - Optimize fair share worker selection strategy implementation. | |
272 | ||
273 | ### Fixed | |
274 | ||
275 | - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled. | |
276 | ||
90ee1b18 | 277 | ## [2.3.1] - 2022-10-13 |
23ff945a JB |
278 | |
279 | ### Added | |
280 | ||
281 | - Pool worker choice strategies: | |
282 | - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now. | |
283 | - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now. | |
284 | ||
90ee1b18 | 285 | ## [2.2.2] - 2022-10-09 |
cb2b6c69 JB |
286 | |
287 | ### Fixed | |
288 | ||
289 | - Fixed `README.md` file. | |
290 | ||
90ee1b18 | 291 | ## [2.2.1] - 2022-10-08 |
bdacc2d2 | 292 | |
bdaf31cd JB |
293 | ### Added |
294 | ||
295 | - Dynamic worker choice strategy change at runtime. | |
bdacc2d2 | 296 | |
90ee1b18 | 297 | ## [2.2.0] - 2022-01-05 |
7e0d447f JB |
298 | |
299 | ### Breaking Changes | |
300 | ||
301 | - Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version. | |
302 | ||
90ee1b18 | 303 | ## [2.1.0] - 2021-08-29 |
35cf1c03 JB |
304 | |
305 | ### Added | |
306 | ||
307 | - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker. | |
e088a00c JB |
308 | |
309 | ### Breaking Changes | |
310 | ||
311 | - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute. | |
312 | - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`. | |
313 | - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`. | |
c365b2d3 | 314 | - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker. |
e088a00c | 315 | |
90ee1b18 | 316 | ## [2.0.2] - 2021-05-12 |
14916bf9 JB |
317 | |
318 | ### Bug fixes | |
319 | ||
320 | - Fix `busy` event emission on fixed pool type | |
321 | ||
90ee1b18 | 322 | ## [2.0.1] - 2021-03-16 |
7f685093 JB |
323 | |
324 | ### Bug fixes | |
325 | ||
326 | - Check if pool options are properly set. | |
327 | - `busy` event is emitted on all pool types. | |
328 | ||
90ee1b18 | 329 | ## [2.0.0] - 2021-03-01 |
fa0f5b28 | 330 | |
f3f833ab | 331 | ### Bug fixes |
d63d3be3 | 332 | |
ddbeaffd | 333 | - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70). |
d63d3be3 | 334 | |
fa0f5b28 S |
335 | ### Breaking Changes |
336 | ||
7f685093 | 337 | - `FullPool` event is now renamed to `busy`. |
1927ee67 | 338 | - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`. |
1a81f8af | 339 | _Find more details on our JSDoc._ |
ddbeaffd | 340 | |
1927ee67 APA |
341 | - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed. |
342 | ||
ddbeaffd | 343 | - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes. |
fa0f5b28 | 344 | |
ec2ccfc8 JB |
345 | ### Pool options types declaration merge |
346 | ||
347 | `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`. | |
348 | ||
fa0f5b28 S |
349 | #### New `export` strategy |
350 | ||
351 | ```js | |
352 | // Before | |
777b7824 | 353 | const DynamicThreadPool = require('poolifier/lib/dynamic') |
fa0f5b28 | 354 | // After |
777b7824 | 355 | const { DynamicThreadPool } = require('poolifier/lib/dynamic') |
fa0f5b28 S |
356 | ``` |
357 | ||
358 | But you should always prefer just using | |
359 | ||
360 | ```js | |
777b7824 | 361 | const { DynamicThreadPool } = require('poolifier') |
fa0f5b28 S |
362 | ``` |
363 | ||
d3c8a1a8 S |
364 | #### New type definitions for input data and response |
365 | ||
ec2ccfc8 | 366 | For cluster worker and worker-thread pools, you can now only send and receive serializable data. |
d3c8a1a8 S |
367 | _This is not a limitation by poolifier but NodeJS._ |
368 | ||
3a4b605f | 369 | #### Public property replacements |
5c5a1fb7 | 370 | |
3a4b605f | 371 | `numWorkers` property is now `numberOfWorkers` |
5c5a1fb7 | 372 | |
280c2a77 | 373 | #### Internal (protected) properties and methods renaming |
fa0f5b28 | 374 | |
280c2a77 S |
375 | These properties are not intended for end users |
376 | ||
377 | - `id` => `nextMessageId` | |
378 | ||
379 | These methods are not intended for end users | |
fa0f5b28 S |
380 | |
381 | - `_chooseWorker` => `chooseWorker` | |
280c2a77 | 382 | - `_newWorker` => `createWorker` |
fa0f5b28 S |
383 | - `_execute` => `internalExecute` |
384 | - `_chooseWorker` => `chooseWorker` | |
385 | - `_checkAlive` => `checkAlive` | |
386 | - `_run` => `run` | |
387 | - `_runAsync` => `runAsync` | |
388 | ||
90ee1b18 | 389 | ## [1.1.0] - 2020-05-21 |
0312f71a APA |
390 | |
391 | ### Added | |
392 | ||
393 | - ThreadWorker support async functions as option | |
cf9aa6c3 | 394 | - Various external library patches |
0312f71a | 395 | |
90ee1b18 | 396 | ## [1.0.0] - 2020-01-24 |
522eea03 | 397 | |
398 | ### Added | |
399 | ||
400 | - FixedThreadPool implementation | |
401 | - DynamicThreadPool implementation | |
0312f71a | 402 | - WorkerThread implementation to improve developer experience |