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