chore: generate documentation
[poolifier.git] / CHANGELOG.md
... / ...
CommitLineData
1# Changelog
2
3All notable changes to this project will be documented in this file.
4
5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
8## [Unreleased]
9
10### Added
11
12- Add `PoolEvents` enumeration and `PoolEvent` type.
13
14### Fixed
15
16- fix: destroy worker only on alive check.
17
18## [2.4.3] - 2023-04-07
19
20### Fixed
21
22- Fix typedoc generation with inheritance.
23
24## [2.4.2] - 2023-04-06
25
26### Added
27
28- Add `full` event to dynamic pool.
29- Keep worker choice strategy in memory for conditional reuse.
30
31### Fixed
32
33- Fix possible negative worker key at worker removal in worker choice strategies.
34
35## [2.4.1] - 2023-04-05
36
37### Changed
38
39- Optimize worker choice strategy for dynamic pool.
40
41### Fixed
42
43- Ensure dynamic pool does not alter worker choice strategy expected behavior.
44
45## [2.4.0] - 2023-04-04
46
47### Added
48
49- Add `LESS_BUSY` worker choice strategy.
50
51### Changed
52
53- Optimize worker storage in pool.
54- Optimize worker alive status check.
55- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
56- Optimize `LESS_USED` worker choice strategy.
57- Update benchmarks versus external threads pools.
58- Optimize tasks usage statistics requirements for worker choice strategy.
59
60### Fixed
61
62- Ensure trimmable characters are checked at pool initialization.
63- Fix message id integer overflow.
64- Fix pool worker removal in worker choice strategy internals.
65- Fix package publication with pnpm.
66
67## [2.4.0-3] - 2023-04-04
68
69### Added
70
71- Add `LESS_BUSY` worker choice strategy.
72
73### Changed
74
75- Optimize worker storage in pool.
76- Optimize worker alive status check.
77- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
78- Optimize `LESS_USED` worker choice strategy.
79- Update benchmarks versus external threads pools.
80
81### Fixed
82
83- Ensure trimmable characters are checked at pool initialization.
84- Fix message id integer overflow.
85- Fix pool worker removal in worker choice strategy internals.
86- Fix package publication with pnpm.
87
88## [2.4.0-2] - 2023-04-03
89
90### Added
91
92- Add `LESS_BUSY` worker choice strategy.
93
94### Changed
95
96- Optimize worker storage in pool.
97- Optimize worker alive status check.
98- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
99- Optimize `LESS_USED` worker choice strategy.
100
101### Fixed
102
103- Ensure trimmable characters are checked at pool initialization.
104- Fix message id integer overflow.
105- Fix pool worker removal in worker choice strategy internals.
106- Fix package publication with pnpm.
107
108## [2.4.0-1] - 2023-04-03
109
110### Added
111
112- Add `LESS_BUSY` worker choice strategy.
113
114### Changed
115
116- Optimize worker storage in pool.
117- Optimize worker alive status check.
118- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
119- Optimize `LESS_USED` worker choice strategy.
120
121### Fixed
122
123- Ensure trimmable characters are checked at pool initialization.
124- Fix message id integer overflow.
125- Fix pool worker removal in worker choice strategy internals.
126
127## [2.4.0-0] - 2023-04-03
128
129### Added
130
131- Add `LESS_BUSY` worker choice strategy.
132
133### Changed
134
135- Optimize worker storage in pool.
136- Optimize worker alive status check.
137- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
138- Optimize `LESS_USED` 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
146## [2.3.10] - 2023-03-18
147
148### Fixed
149
150- Fix `exports` syntax for ESM and CommonJS.
151
152### Changed
153
154- Permit SemVer pre-release publication.
155
156## [2.3.10-2] - 2023-03-18
157
158### Fixed
159
160- Fix `exports` syntax for ESM and CommonJS.
161
162## [2.3.10-1] - 2023-03-18
163
164### Changed
165
166- Permit SemVer pre-release publication.
167
168## [2.3.10-0] - 2023-03-18
169
170### Fixed
171
172- Fix `exports` syntax for ESM and CommonJS.
173
174## [2.3.9] - 2023-03-18
175
176### Changed
177
178- Introduce ESM module support along with CommonJS one.
179
180### Fixed
181
182- Fix brown paper bag bug referencing the same object literal.
183
184## [2.3.8] - 2023-03-18
185
186### Changed
187
188- Switch internal benchmarking code to benny.
189- Switch to TypeScript 5.x.x.
190- Switch rollup bundler plugins to core ones.
191- Switch to TSDoc syntax.
192- Enforce conventional commits.
193
194### Fixed
195
196- Fix random integer generator.
197- Fix worker choice strategy pool type identification at initialization.
198
199## [2.3.7] - 2022-10-23
200
201### Changed
202
203- Switch to open collective FOSS project funding platform.
204- Switch to ts-standard linter configuration on TypeScript code.
205
206### Fixed
207
208- Fixed missing async on pool execute method.
209- Fixed typing in TypeScript example.
210- Fixed types in unit tests.
211
212## [2.3.6] - 2022-10-22
213
214### Changed
215
216- Cleanup pool attributes and methods.
217- Refine error types thrown.
218
219### Fixed
220
221- Fix continuous integration build on windows.
222- Fix code coverage reporting by using c8 instead of nyc.
223
224## [2.3.5] - 2022-10-21
225
226### Changed
227
228- Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
229- Optimize tasks usage lookup implementation.
230
231### Fixed
232
233- Fix missed pool event emitter type export.
234- Fix typedoc documentation generation.
235
236## [2.3.4] - 2022-10-17
237
238### Added
239
240- Fully automate release process with release-it.
241
242### Changed
243
244- Optimize fair share task scheduling algorithm implementation.
245- Update benchmarks versus external pools results with latest version.
246
247## [2.3.3] - 2022-10-15
248
249### Added
250
251- Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
252
253## [2.3.2] - 2022-10-14
254
255### Changed
256
257- Optimize fair share worker selection strategy implementation.
258
259### Fixed
260
261- Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
262
263## [2.3.1] - 2022-10-13
264
265### Added
266
267- Pool worker choice strategies:
268 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
269 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
270
271## [2.2.2] - 2022-10-09
272
273### Fixed
274
275- Fixed `README.md` file.
276
277## [2.2.1] - 2022-10-08
278
279### Added
280
281- Dynamic worker choice strategy change at runtime.
282
283## [2.2.0] - 2022-01-05
284
285### Breaking Changes
286
287- Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
288
289## [2.1.0] - 2021-08-29
290
291### Added
292
293- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
294
295### Breaking Changes
296
297- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
298- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
299- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
300- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
301
302## [2.0.2] - 2021-05-12
303
304### Bug fixes
305
306- Fix `busy` event emission on fixed pool type
307
308## [2.0.1] - 2021-03-16
309
310### Bug fixes
311
312- Check if pool options are properly set.
313- `busy` event is emitted on all pool types.
314
315## [2.0.0] - 2021-03-01
316
317### Bug fixes
318
319- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
320
321### Breaking Changes
322
323- `FullPool` event is now renamed to `busy`.
324- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
325 _Find more details on our JSDoc._
326
327- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
328
329- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
330
331### Pool options types declaration merge
332
333`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
334
335#### New `export` strategy
336
337```js
338// Before
339const DynamicThreadPool = require('poolifier/lib/dynamic')
340// After
341const { DynamicThreadPool } = require('poolifier/lib/dynamic')
342```
343
344But you should always prefer just using
345
346```js
347const { DynamicThreadPool } = require('poolifier')
348```
349
350#### New type definitions for input data and response
351
352For cluster worker and worker-thread pools, you can now only send and receive serializable data.
353_This is not a limitation by poolifier but NodeJS._
354
355#### Public property replacements
356
357`numWorkers` property is now `numberOfWorkers`
358
359#### Internal (protected) properties and methods renaming
360
361These properties are not intended for end users
362
363- `id` => `nextMessageId`
364
365These methods are not intended for end users
366
367- `_chooseWorker` => `chooseWorker`
368- `_newWorker` => `createWorker`
369- `_execute` => `internalExecute`
370- `_chooseWorker` => `chooseWorker`
371- `_checkAlive` => `checkAlive`
372- `_run` => `run`
373- `_runAsync` => `runAsync`
374
375## [1.1.0] - 2020-05-21
376
377### Added
378
379- ThreadWorker support async functions as option
380- Various external library patches
381
382## [1.0.0] - 2020-01-24
383
384### Added
385
386- FixedThreadPool implementation
387- DynamicThreadPool implementation
388- WorkerThread implementation to improve developer experience