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