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