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