3 All notable changes to this project will be documented in this file.
5 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
10 ## [2.4.3] - 2023-04-07
14 - Fix typedoc generation with inheritance.
16 ## [2.4.2] - 2023-04-06
20 - Add `full` event to dynamic pool.
21 - Keep worker choice strategy in memory for conditional reuse.
25 - Fix possible negative worker key at worker removal in worker choice strategies.
27 ## [2.4.1] - 2023-04-05
31 - Optimize worker choice strategy for dynamic pool.
35 - Ensure dynamic pool does not alter worker choice strategy expected behavior.
37 ## [2.4.0] - 2023-04-04
41 - Add `LESS_BUSY` worker choice strategy.
45 - Optimize worker storage in pool.
46 - Optimize worker alive status check.
47 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
48 - Optimize `LESS_USED` worker choice strategy.
49 - Update benchmarks versus external threads pools.
50 - Optimize tasks usage statistics requirements for worker choice strategy.
54 - Ensure trimmable characters are checked at pool initialization.
55 - Fix message id integer overflow.
56 - Fix pool worker removal in worker choice strategy internals.
57 - Fix package publication with pnpm.
59 ## [2.4.0-3] - 2023-04-04
63 - Add `LESS_BUSY` worker choice strategy.
67 - Optimize worker storage in pool.
68 - Optimize worker alive status check.
69 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
70 - Optimize `LESS_USED` worker choice strategy.
71 - Update benchmarks versus external threads pools.
75 - Ensure trimmable characters are checked at pool initialization.
76 - Fix message id integer overflow.
77 - Fix pool worker removal in worker choice strategy internals.
78 - Fix package publication with pnpm.
80 ## [2.4.0-2] - 2023-04-03
84 - Add `LESS_BUSY` worker choice strategy.
88 - Optimize worker storage in pool.
89 - Optimize worker alive status check.
90 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
91 - Optimize `LESS_USED` worker choice strategy.
95 - Ensure trimmable characters are checked at pool initialization.
96 - Fix message id integer overflow.
97 - Fix pool worker removal in worker choice strategy internals.
98 - Fix package publication with pnpm.
100 ## [2.4.0-1] - 2023-04-03
104 - Add `LESS_BUSY` worker choice strategy.
108 - Optimize worker storage in pool.
109 - Optimize worker alive status check.
110 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
111 - Optimize `LESS_USED` worker choice strategy.
115 - Ensure trimmable characters are checked at pool initialization.
116 - Fix message id integer overflow.
117 - Fix pool worker removal in worker choice strategy internals.
119 ## [2.4.0-0] - 2023-04-03
123 - Add `LESS_BUSY` worker choice strategy.
127 - Optimize worker storage in pool.
128 - Optimize worker alive status check.
129 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
130 - Optimize `LESS_USED` worker choice strategy.
134 - Ensure trimmable characters are checked at pool initialization.
135 - Fix message id integer overflow.
136 - Fix pool worker removal in worker choice strategy internals.
138 ## [2.3.10] - 2023-03-18
142 - Fix `exports` syntax for ESM and CommonJS.
146 - Permit SemVer pre-release publication.
148 ## [2.3.10-2] - 2023-03-18
152 - Fix `exports` syntax for ESM and CommonJS.
154 ## [2.3.10-1] - 2023-03-18
158 - Permit SemVer pre-release publication.
160 ## [2.3.10-0] - 2023-03-18
164 - Fix `exports` syntax for ESM and CommonJS.
166 ## [2.3.9] - 2023-03-18
170 - Introduce ESM module support along with CommonJS one.
174 - Fix brown paper bag bug referencing the same object literal.
176 ## [2.3.8] - 2023-03-18
180 - Switch internal benchmarking code to benny.
181 - Switch to TypeScript 5.x.x.
182 - Switch rollup bundler plugins to core ones.
183 - Switch to TSDoc syntax.
184 - Enforce conventional commits.
188 - Fix random integer generator.
189 - Fix worker choice strategy pool type identification at initialization.
191 ## [2.3.7] - 2022-10-23
195 - Switch to open collective FOSS project funding platform.
196 - Switch to ts-standard linter configuration on TypeScript code.
200 - Fixed missing async on pool execute method.
201 - Fixed typing in TypeScript example.
202 - Fixed types in unit tests.
204 ## [2.3.6] - 2022-10-22
208 - Cleanup pool attributes and methods.
209 - Refine error types thrown.
213 - Fix continuous integration build on windows.
214 - Fix code coverage reporting by using c8 instead of nyc.
216 ## [2.3.5] - 2022-10-21
220 - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
221 - Optimize tasks usage lookup implementation.
225 - Fix missed pool event emitter type export.
226 - Fix typedoc documentation generation.
228 ## [2.3.4] - 2022-10-17
232 - Fully automate release process with release-it.
236 - Optimize fair share task scheduling algorithm implementation.
237 - Update benchmarks versus external pools results with latest version.
239 ## [2.3.3] - 2022-10-15
243 - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
245 ## [2.3.2] - 2022-10-14
249 - Optimize fair share worker selection strategy implementation.
253 - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
255 ## [2.3.1] - 2022-10-13
259 - Pool worker choice strategies:
260 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
261 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
263 ## [2.2.2] - 2022-10-09
267 - Fixed `README.md` file.
269 ## [2.2.1] - 2022-10-08
273 - Dynamic worker choice strategy change at runtime.
275 ## [2.2.0] - 2022-01-05
279 - Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
281 ## [2.1.0] - 2021-08-29
285 - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
289 - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
290 - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
291 - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
292 - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
294 ## [2.0.2] - 2021-05-12
298 - Fix `busy` event emission on fixed pool type
300 ## [2.0.1] - 2021-03-16
304 - Check if pool options are properly set.
305 - `busy` event is emitted on all pool types.
307 ## [2.0.0] - 2021-03-01
311 - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
315 - `FullPool` event is now renamed to `busy`.
316 - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
317 _Find more details on our JSDoc._
319 - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
321 - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
323 ### Pool options types declaration merge
325 `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
327 #### New `export` strategy
331 const DynamicThreadPool = require('poolifier/lib/dynamic')
333 const { DynamicThreadPool } = require('poolifier/lib/dynamic')
336 But you should always prefer just using
339 const { DynamicThreadPool } = require('poolifier')
342 #### New type definitions for input data and response
344 For cluster worker and worker-thread pools, you can now only send and receive serializable data.
345 _This is not a limitation by poolifier but NodeJS._
347 #### Public property replacements
349 `numWorkers` property is now `numberOfWorkers`
351 #### Internal (protected) properties and methods renaming
353 These properties are not intended for end users
355 - `id` => `nextMessageId`
357 These methods are not intended for end users
359 - `_chooseWorker` => `chooseWorker`
360 - `_newWorker` => `createWorker`
361 - `_execute` => `internalExecute`
362 - `_chooseWorker` => `chooseWorker`
363 - `_checkAlive` => `checkAlive`
365 - `_runAsync` => `runAsync`
367 ## [1.1.0] - 2020-05-21
371 - ThreadWorker support async functions as option
372 - Various external library patches
374 ## [1.0.0] - 2020-01-24
378 - FixedThreadPool implementation
379 - DynamicThreadPool implementation
380 - WorkerThread implementation to improve developer experience