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