fix: brown paper bag bug referencing the same object literal
[poolifier.git] / CHANGELOG.md
1 # Changelog
2
3 All notable changes to this project will be documented in this file.
4
5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
8 ## [Unreleased]
9
10 ### Changed
11
12 - Introduce ESM module support along with CommonJS one.
13
14 ### Fixed
15
16 - Fix brown paper bag bug referencing the same object literal.
17
18 ## [2.3.8] - 2023-03-18
19
20 ### Changed
21
22 - Switch internal benchmarking code to benny.
23 - Switch to TypeScript 5.x.x.
24 - Switch rollup bundler plugins to core ones.
25 - Switch to TSDoc syntax.
26 - Enforce conventional commits.
27
28 ### Fixed
29
30 - Fix random integer generator.
31 - Fix worker choice strategy pool type identification at initialization.
32
33 ## [2.3.7] - 2022-10-23
34
35 ### Changed
36
37 - Switch to open collective FOSS project funding platform.
38 - Switch to ts-standard linter configuration on TypeScript code.
39
40 ### Fixed
41
42 - Fixed missing async on pool execute method.
43 - Fixed typing in TypeScript example.
44 - Fixed types in unit tests.
45
46 ## [2.3.6] - 2022-10-22
47
48 ### Changed
49
50 - Cleanup pool attributes and methods.
51 - Refine error types thrown.
52
53 ### Fixed
54
55 - Fix continuous integration build on windows.
56 - Fix code coverage reporting by using c8 instead of nyc.
57
58 ## [2.3.5] - 2022-10-21
59
60 ### Changed
61
62 - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
63 - Optimize tasks usage lookup implementation.
64
65 ### Fixed
66
67 - Fix missed pool event emitter type export.
68 - Fix typedoc documentation generation.
69
70 ## [2.3.4] - 2022-10-17
71
72 ### Added
73
74 - Fully automate release process with release-it.
75
76 ### Changed
77
78 - Optimize fair share task scheduling algorithm implementation.
79 - Update benchmarks versus external pools results with latest version.
80
81 ## [2.3.3] - 2022-10-15
82
83 ### Added
84
85 - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
86
87 ## [2.3.2] - 2022-10-14
88
89 ### Changed
90
91 - Optimize fair share worker selection strategy implementation.
92
93 ### Fixed
94
95 - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
96
97 ## [2.3.1] - 2022-10-13
98
99 ### Added
100
101 - Pool worker choice strategies:
102 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
103 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
104
105 ## [2.2.2] - 2022-10-09
106
107 ### Fixed
108
109 - Fixed `README.md` file.
110
111 ## [2.2.1] - 2022-10-08
112
113 ### Added
114
115 - Dynamic worker choice strategy change at runtime.
116
117 ## [2.2.0] - 2022-01-05
118
119 ### Breaking Changes
120
121 - Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
122
123 ## [2.1.0] - 2021-08-29
124
125 ### Added
126
127 - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
128
129 ### Breaking Changes
130
131 - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
132 - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
133 - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
134 - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
135
136 ## [2.0.2] - 2021-05-12
137
138 ### Bug fixes
139
140 - Fix `busy` event emission on fixed pool type
141
142 ## [2.0.1] - 2021-03-16
143
144 ### Bug fixes
145
146 - Check if pool options are properly set.
147 - `busy` event is emitted on all pool types.
148
149 ## [2.0.0] - 2021-03-01
150
151 ### Bug fixes
152
153 - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
154
155 ### Breaking Changes
156
157 - `FullPool` event is now renamed to `busy`.
158 - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
159 _Find more details on our JSDoc._
160
161 - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
162
163 - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
164
165 ### Pool options types declaration merge
166
167 `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
168
169 #### New `export` strategy
170
171 ```js
172 // Before
173 const DynamicThreadPool = require('poolifier/lib/dynamic')
174 // After
175 const { DynamicThreadPool } = require('poolifier/lib/dynamic')
176 ```
177
178 But you should always prefer just using
179
180 ```js
181 const { DynamicThreadPool } = require('poolifier')
182 ```
183
184 #### New type definitions for input data and response
185
186 For cluster worker and worker-thread pools, you can now only send and receive serializable data.
187 _This is not a limitation by poolifier but NodeJS._
188
189 #### Public property replacements
190
191 `numWorkers` property is now `numberOfWorkers`
192
193 #### Internal (protected) properties and methods renaming
194
195 These properties are not intended for end users
196
197 - `id` => `nextMessageId`
198
199 These methods are not intended for end users
200
201 - `_chooseWorker` => `chooseWorker`
202 - `_newWorker` => `createWorker`
203 - `_execute` => `internalExecute`
204 - `_chooseWorker` => `chooseWorker`
205 - `_checkAlive` => `checkAlive`
206 - `_run` => `run`
207 - `_runAsync` => `runAsync`
208
209 ## [1.1.0] - 2020-05-21
210
211 ### Added
212
213 - ThreadWorker support async functions as option
214 - Various external library patches
215
216 ## [1.0.0] - 2020-01-24
217
218 ### Added
219
220 - FixedThreadPool implementation
221 - DynamicThreadPool implementation
222 - WorkerThread implementation to improve developer experience