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).
12 - Fix typedoc generation with inheritance.
14 ## [2.4.2] - 2023-04-06
18 - Add `full` event to dynamic pool.
19 - Keep worker choice strategy in memory for conditional reuse.
23 - Fix possible negative worker key at worker removal in worker choice strategies.
25 ## [2.4.1] - 2023-04-05
29 - Optimize worker choice strategy for dynamic pool.
33 - Ensure dynamic pool does not alter worker choice strategy expected behavior.
35 ## [2.4.0] - 2023-04-04
39 - Add `LESS_BUSY` worker choice strategy.
43 - Optimize worker storage in pool.
44 - Optimize worker alive status check.
45 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
46 - Optimize `LESS_USED` worker choice strategy.
47 - Update benchmarks versus external threads pools.
48 - Optimize tasks usage statistics requirements for worker choice strategy.
52 - Ensure trimmable characters are checked at pool initialization.
53 - Fix message id integer overflow.
54 - Fix pool worker removal in worker choice strategy internals.
55 - Fix package publication with pnpm.
57 ## [2.4.0-3] - 2023-04-04
61 - Add `LESS_BUSY` worker choice strategy.
65 - Optimize worker storage in pool.
66 - Optimize worker alive status check.
67 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
68 - Optimize `LESS_USED` worker choice strategy.
69 - Update benchmarks versus external threads pools.
73 - Ensure trimmable characters are checked at pool initialization.
74 - Fix message id integer overflow.
75 - Fix pool worker removal in worker choice strategy internals.
76 - Fix package publication with pnpm.
78 ## [2.4.0-2] - 2023-04-03
82 - Add `LESS_BUSY` worker choice strategy.
86 - Optimize worker storage in pool.
87 - Optimize worker alive status check.
88 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
89 - Optimize `LESS_USED` worker choice strategy.
93 - Ensure trimmable characters are checked at pool initialization.
94 - Fix message id integer overflow.
95 - Fix pool worker removal in worker choice strategy internals.
96 - Fix package publication with pnpm.
98 ## [2.4.0-1] - 2023-04-03
102 - Add `LESS_BUSY` worker choice strategy.
106 - Optimize worker storage in pool.
107 - Optimize worker alive status check.
108 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
109 - Optimize `LESS_USED` worker choice strategy.
113 - Ensure trimmable characters are checked at pool initialization.
114 - Fix message id integer overflow.
115 - Fix pool worker removal in worker choice strategy internals.
117 ## [2.4.0-0] - 2023-04-03
121 - Add `LESS_BUSY` worker choice strategy.
125 - Optimize worker storage in pool.
126 - Optimize worker alive status check.
127 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
128 - Optimize `LESS_USED` worker choice strategy.
132 - Ensure trimmable characters are checked at pool initialization.
133 - Fix message id integer overflow.
134 - Fix pool worker removal in worker choice strategy internals.
136 ## [2.3.10] - 2023-03-18
140 - Fix `exports` syntax for ESM and CommonJS.
144 - Permit SemVer pre-release publication.
146 ## [2.3.10-2] - 2023-03-18
150 - Fix `exports` syntax for ESM and CommonJS.
152 ## [2.3.10-1] - 2023-03-18
156 - Permit SemVer pre-release publication.
158 ## [2.3.10-0] - 2023-03-18
162 - Fix `exports` syntax for ESM and CommonJS.
164 ## [2.3.9] - 2023-03-18
168 - Introduce ESM module support along with CommonJS one.
172 - Fix brown paper bag bug referencing the same object literal.
174 ## [2.3.8] - 2023-03-18
178 - Switch internal benchmarking code to benny.
179 - Switch to TypeScript 5.x.x.
180 - Switch rollup bundler plugins to core ones.
181 - Switch to TSDoc syntax.
182 - Enforce conventional commits.
186 - Fix random integer generator.
187 - Fix worker choice strategy pool type identification at initialization.
189 ## [2.3.7] - 2022-10-23
193 - Switch to open collective FOSS project funding platform.
194 - Switch to ts-standard linter configuration on TypeScript code.
198 - Fixed missing async on pool execute method.
199 - Fixed typing in TypeScript example.
200 - Fixed types in unit tests.
202 ## [2.3.6] - 2022-10-22
206 - Cleanup pool attributes and methods.
207 - Refine error types thrown.
211 - Fix continuous integration build on windows.
212 - Fix code coverage reporting by using c8 instead of nyc.
214 ## [2.3.5] - 2022-10-21
218 - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
219 - Optimize tasks usage lookup implementation.
223 - Fix missed pool event emitter type export.
224 - Fix typedoc documentation generation.
226 ## [2.3.4] - 2022-10-17
230 - Fully automate release process with release-it.
234 - Optimize fair share task scheduling algorithm implementation.
235 - Update benchmarks versus external pools results with latest version.
237 ## [2.3.3] - 2022-10-15
241 - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
243 ## [2.3.2] - 2022-10-14
247 - Optimize fair share worker selection strategy implementation.
251 - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
253 ## [2.3.1] - 2022-10-13
257 - Pool worker choice strategies:
258 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
259 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
261 ## [2.2.2] - 2022-10-09
265 - Fixed `README.md` file.
267 ## [2.2.1] - 2022-10-08
271 - Dynamic worker choice strategy change at runtime.
273 ## [2.2.0] - 2022-01-05
277 - Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
279 ## [2.1.0] - 2021-08-29
283 - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
287 - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
288 - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
289 - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
290 - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
292 ## [2.0.2] - 2021-05-12
296 - Fix `busy` event emission on fixed pool type
298 ## [2.0.1] - 2021-03-16
302 - Check if pool options are properly set.
303 - `busy` event is emitted on all pool types.
305 ## [2.0.0] - 2021-03-01
309 - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
313 - `FullPool` event is now renamed to `busy`.
314 - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
315 _Find more details on our JSDoc._
317 - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
319 - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
321 ### Pool options types declaration merge
323 `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
325 #### New `export` strategy
329 const DynamicThreadPool = require('poolifier/lib/dynamic')
331 const { DynamicThreadPool } = require('poolifier/lib/dynamic')
334 But you should always prefer just using
337 const { DynamicThreadPool } = require('poolifier')
340 #### New type definitions for input data and response
342 For cluster worker and worker-thread pools, you can now only send and receive serializable data.
343 _This is not a limitation by poolifier but NodeJS._
345 #### Public property replacements
347 `numWorkers` property is now `numberOfWorkers`
349 #### Internal (protected) properties and methods renaming
351 These properties are not intended for end users
353 - `id` => `nextMessageId`
355 These methods are not intended for end users
357 - `_chooseWorker` => `chooseWorker`
358 - `_newWorker` => `createWorker`
359 - `_execute` => `internalExecute`
360 - `_chooseWorker` => `chooseWorker`
361 - `_checkAlive` => `checkAlive`
363 - `_runAsync` => `runAsync`
365 ## [1.1.0] - 2020-05-21
369 - ThreadWorker support async functions as option
370 - Various external library patches
372 ## [1.0.0] - 2020-01-24
376 - FixedThreadPool implementation
377 - DynamicThreadPool implementation
378 - WorkerThread implementation to improve developer experience