docs: update changelog entries
[poolifier.git] / CHANGELOG.md
1 # Changelog
2
3 All notable changes to this project will be documented in this file.
4
5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
8 ## [Unreleased]
9
10 ### Fixed
11
12 - Ensure one task at a time is executed per worker with tasks queueing enabled.
13
14 ## [2.4.5] - 2023-04-09
15
16 ### Added
17
18 - Use monotonic high resolution timer for worker tasks run time.
19 - Add worker tasks median run time to statistics.
20 - Add worker tasks queue (experimental).
21
22 ## [2.4.4] - 2023-04-07
23
24 ### Added
25
26 - Add `PoolEvents` enumeration and `PoolEvent` type.
27
28 ### Fixed
29
30 - Destroy worker only on alive check.
31
32 ## [2.4.3] - 2023-04-07
33
34 ### Fixed
35
36 - Fix typedoc generation with inheritance.
37
38 ## [2.4.2] - 2023-04-06
39
40 ### Added
41
42 - Add `full` event to dynamic pool.
43 - Keep worker choice strategy in memory for conditional reuse.
44
45 ### Fixed
46
47 - Fix possible negative worker key at worker removal in worker choice strategies.
48
49 ## [2.4.1] - 2023-04-05
50
51 ### Changed
52
53 - Optimize worker choice strategy for dynamic pool.
54
55 ### Fixed
56
57 - Ensure dynamic pool does not alter worker choice strategy expected behavior.
58
59 ## [2.4.0] - 2023-04-04
60
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
81 ## [2.4.0-3] - 2023-04-04
82
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
102 ## [2.4.0-2] - 2023-04-03
103
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
122 ## [2.4.0-1] - 2023-04-03
123
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
141 ## [2.4.0-0] - 2023-04-03
142
143 ### Added
144
145 - Add `LESS_BUSY` worker choice strategy.
146
147 ### Changed
148
149 - Optimize worker storage in pool.
150 - Optimize worker alive status check.
151 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
152 - Optimize `LESS_USED` worker choice strategy.
153
154 ### Fixed
155
156 - Ensure trimmable characters are checked at pool initialization.
157 - Fix message id integer overflow.
158 - Fix pool worker removal in worker choice strategy internals.
159
160 ## [2.3.10] - 2023-03-18
161
162 ### Fixed
163
164 - Fix `exports` syntax for ESM and CommonJS.
165
166 ### Changed
167
168 - Permit SemVer pre-release publication.
169
170 ## [2.3.10-2] - 2023-03-18
171
172 ### Fixed
173
174 - Fix `exports` syntax for ESM and CommonJS.
175
176 ## [2.3.10-1] - 2023-03-18
177
178 ### Changed
179
180 - Permit SemVer pre-release publication.
181
182 ## [2.3.10-0] - 2023-03-18
183
184 ### Fixed
185
186 - Fix `exports` syntax for ESM and CommonJS.
187
188 ## [2.3.9] - 2023-03-18
189
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
198 ## [2.3.8] - 2023-03-18
199
200 ### Changed
201
202 - Switch internal benchmarking code to benny.
203 - Switch to TypeScript 5.x.x.
204 - Switch rollup bundler plugins to core ones.
205 - Switch to TSDoc syntax.
206 - Enforce conventional commits.
207
208 ### Fixed
209
210 - Fix random integer generator.
211 - Fix worker choice strategy pool type identification at initialization.
212
213 ## [2.3.7] - 2022-10-23
214
215 ### Changed
216
217 - Switch to open collective FOSS project funding platform.
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.
225
226 ## [2.3.6] - 2022-10-22
227
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
238 ## [2.3.5] - 2022-10-21
239
240 ### Changed
241
242 - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
243 - Optimize tasks usage lookup implementation.
244
245 ### Fixed
246
247 - Fix missed pool event emitter type export.
248 - Fix typedoc documentation generation.
249
250 ## [2.3.4] - 2022-10-17
251
252 ### Added
253
254 - Fully automate release process with release-it.
255
256 ### Changed
257
258 - Optimize fair share task scheduling algorithm implementation.
259 - Update benchmarks versus external pools results with latest version.
260
261 ## [2.3.3] - 2022-10-15
262
263 ### Added
264
265 - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
266
267 ## [2.3.2] - 2022-10-14
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
277 ## [2.3.1] - 2022-10-13
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
285 ## [2.2.2] - 2022-10-09
286
287 ### Fixed
288
289 - Fixed `README.md` file.
290
291 ## [2.2.1] - 2022-10-08
292
293 ### Added
294
295 - Dynamic worker choice strategy change at runtime.
296
297 ## [2.2.0] - 2022-01-05
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
303 ## [2.1.0] - 2021-08-29
304
305 ### Added
306
307 - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
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`.
314 - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
315
316 ## [2.0.2] - 2021-05-12
317
318 ### Bug fixes
319
320 - Fix `busy` event emission on fixed pool type
321
322 ## [2.0.1] - 2021-03-16
323
324 ### Bug fixes
325
326 - Check if pool options are properly set.
327 - `busy` event is emitted on all pool types.
328
329 ## [2.0.0] - 2021-03-01
330
331 ### Bug fixes
332
333 - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
334
335 ### Breaking Changes
336
337 - `FullPool` event is now renamed to `busy`.
338 - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
339 _Find more details on our JSDoc._
340
341 - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
342
343 - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
344
345 ### Pool options types declaration merge
346
347 `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
348
349 #### New `export` strategy
350
351 ```js
352 // Before
353 const DynamicThreadPool = require('poolifier/lib/dynamic')
354 // After
355 const { DynamicThreadPool } = require('poolifier/lib/dynamic')
356 ```
357
358 But you should always prefer just using
359
360 ```js
361 const { DynamicThreadPool } = require('poolifier')
362 ```
363
364 #### New type definitions for input data and response
365
366 For cluster worker and worker-thread pools, you can now only send and receive serializable data.
367 _This is not a limitation by poolifier but NodeJS._
368
369 #### Public property replacements
370
371 `numWorkers` property is now `numberOfWorkers`
372
373 #### Internal (protected) properties and methods renaming
374
375 These properties are not intended for end users
376
377 - `id` => `nextMessageId`
378
379 These methods are not intended for end users
380
381 - `_chooseWorker` => `chooseWorker`
382 - `_newWorker` => `createWorker`
383 - `_execute` => `internalExecute`
384 - `_chooseWorker` => `chooseWorker`
385 - `_checkAlive` => `checkAlive`
386 - `_run` => `run`
387 - `_runAsync` => `runAsync`
388
389 ## [1.1.0] - 2020-05-21
390
391 ### Added
392
393 - ThreadWorker support async functions as option
394 - Various external library patches
395
396 ## [1.0.0] - 2020-01-24
397
398 ### Added
399
400 - FixedThreadPool implementation
401 - DynamicThreadPool implementation
402 - WorkerThread implementation to improve developer experience