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 - Ensure dynamic pool does not alter worker choice strategy expected behavior.
14 ## [2.4.0] - 2023-04-04
18 - Add `LESS_BUSY` worker choice strategy.
22 - Optimize worker storage in pool.
23 - Optimize worker alive status check.
24 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
25 - Optimize `LESS_USED` worker choice strategy.
26 - Update benchmarks versus external threads pools.
27 - Optimize tasks usage statistics requirements for worker choice strategy.
31 - Ensure trimmable characters are checked at pool initialization.
32 - Fix message id integer overflow.
33 - Fix pool worker removal in worker choice strategy internals.
34 - Fix package publication with pnpm.
36 ## [2.4.0-3] - 2023-04-04
40 - Add `LESS_BUSY` worker choice strategy.
44 - Optimize worker storage in pool.
45 - Optimize worker alive status check.
46 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
47 - Optimize `LESS_USED` worker choice strategy.
48 - Update benchmarks versus external threads pools.
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-2] - 2023-04-03
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.
72 - Ensure trimmable characters are checked at pool initialization.
73 - Fix message id integer overflow.
74 - Fix pool worker removal in worker choice strategy internals.
75 - Fix package publication with pnpm.
77 ## [2.4.0-1] - 2023-04-03
81 - Add `LESS_BUSY` worker choice strategy.
85 - Optimize worker storage in pool.
86 - Optimize worker alive status check.
87 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
88 - Optimize `LESS_USED` worker choice strategy.
92 - Ensure trimmable characters are checked at pool initialization.
93 - Fix message id integer overflow.
94 - Fix pool worker removal in worker choice strategy internals.
96 ## [2.4.0-0] - 2023-04-03
100 - Add `LESS_BUSY` worker choice strategy.
104 - Optimize worker storage in pool.
105 - Optimize worker alive status check.
106 - BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
107 - Optimize `LESS_USED` worker choice strategy.
111 - Ensure trimmable characters are checked at pool initialization.
112 - Fix message id integer overflow.
113 - Fix pool worker removal in worker choice strategy internals.
115 ## [2.3.10] - 2023-03-18
119 - Fix `exports` syntax for ESM and CommonJS.
123 - Permit SemVer pre-release publication.
125 ## [2.3.10-2] - 2023-03-18
129 - Fix `exports` syntax for ESM and CommonJS.
131 ## [2.3.10-1] - 2023-03-18
135 - Permit SemVer pre-release publication.
137 ## [2.3.10-0] - 2023-03-18
141 - Fix `exports` syntax for ESM and CommonJS.
143 ## [2.3.9] - 2023-03-18
147 - Introduce ESM module support along with CommonJS one.
151 - Fix brown paper bag bug referencing the same object literal.
153 ## [2.3.8] - 2023-03-18
157 - Switch internal benchmarking code to benny.
158 - Switch to TypeScript 5.x.x.
159 - Switch rollup bundler plugins to core ones.
160 - Switch to TSDoc syntax.
161 - Enforce conventional commits.
165 - Fix random integer generator.
166 - Fix worker choice strategy pool type identification at initialization.
168 ## [2.3.7] - 2022-10-23
172 - Switch to open collective FOSS project funding platform.
173 - Switch to ts-standard linter configuration on TypeScript code.
177 - Fixed missing async on pool execute method.
178 - Fixed typing in TypeScript example.
179 - Fixed types in unit tests.
181 ## [2.3.6] - 2022-10-22
185 - Cleanup pool attributes and methods.
186 - Refine error types thrown.
190 - Fix continuous integration build on windows.
191 - Fix code coverage reporting by using c8 instead of nyc.
193 ## [2.3.5] - 2022-10-21
197 - Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
198 - Optimize tasks usage lookup implementation.
202 - Fix missed pool event emitter type export.
203 - Fix typedoc documentation generation.
205 ## [2.3.4] - 2022-10-17
209 - Fully automate release process with release-it.
213 - Optimize fair share task scheduling algorithm implementation.
214 - Update benchmarks versus external pools results with latest version.
216 ## [2.3.3] - 2022-10-15
220 - Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
222 ## [2.3.2] - 2022-10-14
226 - Optimize fair share worker selection strategy implementation.
230 - Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
232 ## [2.3.1] - 2022-10-13
236 - Pool worker choice strategies:
237 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
238 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
240 ## [2.2.2] - 2022-10-09
244 - Fixed `README.md` file.
246 ## [2.2.1] - 2022-10-08
250 - Dynamic worker choice strategy change at runtime.
252 ## [2.2.0] - 2022-01-05
256 - Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
258 ## [2.1.0] - 2021-08-29
262 - Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
266 - `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
267 - `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
268 - `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
269 - `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
271 ## [2.0.2] - 2021-05-12
275 - Fix `busy` event emission on fixed pool type
277 ## [2.0.1] - 2021-03-16
281 - Check if pool options are properly set.
282 - `busy` event is emitted on all pool types.
284 ## [2.0.0] - 2021-03-01
288 - Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
292 - `FullPool` event is now renamed to `busy`.
293 - `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
294 _Find more details on our JSDoc._
296 - `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
298 - We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
300 ### Pool options types declaration merge
302 `FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
304 #### New `export` strategy
308 const DynamicThreadPool = require('poolifier/lib/dynamic')
310 const { DynamicThreadPool } = require('poolifier/lib/dynamic')
313 But you should always prefer just using
316 const { DynamicThreadPool } = require('poolifier')
319 #### New type definitions for input data and response
321 For cluster worker and worker-thread pools, you can now only send and receive serializable data.
322 _This is not a limitation by poolifier but NodeJS._
324 #### Public property replacements
326 `numWorkers` property is now `numberOfWorkers`
328 #### Internal (protected) properties and methods renaming
330 These properties are not intended for end users
332 - `id` => `nextMessageId`
334 These methods are not intended for end users
336 - `_chooseWorker` => `chooseWorker`
337 - `_newWorker` => `createWorker`
338 - `_execute` => `internalExecute`
339 - `_chooseWorker` => `chooseWorker`
340 - `_checkAlive` => `checkAlive`
342 - `_runAsync` => `runAsync`
344 ## [1.1.0] - 2020-05-21
348 - ThreadWorker support async functions as option
349 - Various external library patches
351 ## [1.0.0] - 2020-01-24
355 - FixedThreadPool implementation
356 - DynamicThreadPool implementation
357 - WorkerThread implementation to improve developer experience