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