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