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