docs: refine task statistics description
[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## [2.5.4] - 2023-06-07
11
12### Added
13
14- Add Event Loop Utilization (ELU) statistics to worker tasks usage.
15
16### Changed
17
18- Compute statistics at the worker level only if needed.
19- Add `worker-threads` options to thread pool options.
20
21### Fixed
22
23- Make the `LEAST_BUSY` strategy only relies on task runtime.
24
25## [2.5.3] - 2023-06-04
26
27### Changed
28
29- Refine pool information content.
30- Limit pool internals public exposure.
31
32## [2.5.2] - 2023-06-02
33
34### Added
35
36- Add `taskError` pool event for task execution error.
37- Add pool information `info` property to pool.
38- Emit pool information on `busy` and `full` pool events.
39
40## [2.5.1] - 2023-06-01
41
42### Added
43
44- Add pool option `restartWorkerOnError` to restart worker on uncaught error. Default to `true`.
45- Add `error` pool event for uncaught worker error.
46
47## [2.5.0] - 2023-05-31
48
49### Added
50
51- Switch pool event emitter to `EventEmitterAsyncResource`.
52- Add tasks wait time accounting in per worker tasks usage.
53- Add interleaved weighted round robin worker choice strategy (experimental).
54
55### Changed
56
57- Renamed worker choice strategy `LESS_BUSY` to `LEAST_BUSY` and `LESS_USED` to `LEAST_USED`.
58
59## [2.4.14] - 2023-05-09
60
61### Fixed
62
63- Ensure no undefined task runtime can land in the tasks history.
64- Fix median computation implementation once again.
65
66### Added
67
68- Unit tests for median and queue implementations.
69
70## [2.4.13] - 2023-05-08
71
72### Fixed
73
74- Fix worker choice strategy options validation.
75- Fix fair share worker choice strategy internals update: ensure virtual task end timestamp is computed at task submission.
76
77## [2.4.12] - 2023-05-06
78
79### Added
80
81- Support multiple task functions per worker.
82- Add custom worker weights support to worker choice strategies options.
83
84### Changed
85
86- Use O(1) queue implementation for tasks queueing.
87
88### Fixed
89
90- Fix median computation implementation.
91- Fix fair share worker choice strategy internals update.
92
93## [2.4.11] - 2023-04-23
94
95### Changed
96
97- Optimize free worker finding in worker choice strategies.
98
99## [2.4.10] - 2023-04-15
100
101### Fixed
102
103- Fix typescript type definition for worker function: ensure the input data is optional.
104- Fix typescript type definition for pool execute(): ensure the input data is optional.
105
106## [2.4.9] - 2023-04-15
107
108### Added
109
110- Add tasks queue enablement runtime setter to pool.
111- Add tasks queue options runtime setter to pool.
112- Add worker choice strategy options runtime setter to pool.
113
114### Changed
115
116- Remove the tasks queuing experimental status.
117
118### Fixed
119
120- Fix worker function type definition and validation.
121- Fix worker choice strategy options handling.
122
123## [2.4.8] - 2023-04-12
124
125### Fixed
126
127- Fix message between main worker and worker type definition for tasks.
128- Fix code documentation.
129
130## [2.4.7] - 2023-04-11
131
132### Added
133
134- Add worker tasks queue options to pool options.
135
136### Fixed
137
138- Fix missing documentation.
139
140## [2.4.6] - 2023-04-10
141
142### Fixed
143
144- Ensure one task at a time is executed per worker with tasks queueing enabled.
145- Properly count worker running tasks with tasks queueing enabled.
146
147## [2.4.5] - 2023-04-09
148
149### Added
150
151- Use monotonic high resolution timer for worker tasks runtime.
152- Add worker tasks median runtime to statistics.
153- Add worker tasks queue (experimental).
154
155## [2.4.4] - 2023-04-07
156
157### Added
158
159- Add `PoolEvents` enumeration and `PoolEvent` type.
160
161### Fixed
162
163- Destroy worker only on alive check.
164
165## [2.4.3] - 2023-04-07
166
167### Fixed
168
169- Fix typedoc generation with inheritance.
170
171## [2.4.2] - 2023-04-06
172
173### Added
174
175- Add `full` event to dynamic pool.
176- Keep worker choice strategy in memory for conditional reuse.
177
178### Fixed
179
180- Fix possible negative worker key at worker removal in worker choice strategies.
181
182## [2.4.1] - 2023-04-05
183
184### Changed
185
186- Optimize worker choice strategy for dynamic pool.
187
188### Fixed
189
190- Ensure dynamic pool does not alter worker choice strategy expected behavior.
191
192## [2.4.0] - 2023-04-04
193
194### Added
195
196- Add `LESS_BUSY` worker choice strategy.
197
198### Changed
199
200- Optimize worker storage in pool.
201- Optimize worker alive status check.
202- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
203- Optimize `LESS_USED` worker choice strategy.
204- Update benchmarks versus external threads pools.
205- Optimize tasks usage statistics requirements for worker choice strategy.
206
207### Fixed
208
209- Ensure trimmable characters are checked at pool initialization.
210- Fix message id integer overflow.
211- Fix pool worker removal in worker choice strategy internals.
212- Fix package publication with pnpm.
213
214## [2.4.0-3] - 2023-04-04
215
216### Added
217
218- Add `LESS_BUSY` worker choice strategy.
219
220### Changed
221
222- Optimize worker storage in pool.
223- Optimize worker alive status check.
224- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
225- Optimize `LESS_USED` worker choice strategy.
226- Update benchmarks versus external threads pools.
227
228### Fixed
229
230- Ensure trimmable characters are checked at pool initialization.
231- Fix message id integer overflow.
232- Fix pool worker removal in worker choice strategy internals.
233- Fix package publication with pnpm.
234
235## [2.4.0-2] - 2023-04-03
236
237### Added
238
239- Add `LESS_BUSY` worker choice strategy.
240
241### Changed
242
243- Optimize worker storage in pool.
244- Optimize worker alive status check.
245- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
246- Optimize `LESS_USED` worker choice strategy.
247
248### Fixed
249
250- Ensure trimmable characters are checked at pool initialization.
251- Fix message id integer overflow.
252- Fix pool worker removal in worker choice strategy internals.
253- Fix package publication with pnpm.
254
255## [2.4.0-1] - 2023-04-03
256
257### Added
258
259- Add `LESS_BUSY` worker choice strategy.
260
261### Changed
262
263- Optimize worker storage in pool.
264- Optimize worker alive status check.
265- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
266- Optimize `LESS_USED` worker choice strategy.
267
268### Fixed
269
270- Ensure trimmable characters are checked at pool initialization.
271- Fix message id integer overflow.
272- Fix pool worker removal in worker choice strategy internals.
273
274## [2.4.0-0] - 2023-04-03
275
276### Added
277
278- Add `LESS_BUSY` worker choice strategy.
279
280### Changed
281
282- Optimize worker storage in pool.
283- Optimize worker alive status check.
284- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
285- Optimize `LESS_USED` worker choice strategy.
286
287### Fixed
288
289- Ensure trimmable characters are checked at pool initialization.
290- Fix message id integer overflow.
291- Fix pool worker removal in worker choice strategy internals.
292
293## [2.3.10] - 2023-03-18
294
295### Fixed
296
297- Fix `exports` syntax for ESM and CommonJS.
298
299### Changed
300
301- Permit SemVer pre-release publication.
302
303## [2.3.10-2] - 2023-03-18
304
305### Fixed
306
307- Fix `exports` syntax for ESM and CommonJS.
308
309## [2.3.10-1] - 2023-03-18
310
311### Changed
312
313- Permit SemVer pre-release publication.
314
315## [2.3.10-0] - 2023-03-18
316
317### Fixed
318
319- Fix `exports` syntax for ESM and CommonJS.
320
321## [2.3.9] - 2023-03-18
322
323### Changed
324
325- Introduce ESM module support along with CommonJS one.
326
327### Fixed
328
329- Fix brown paper bag bug referencing the same object literal.
330
331## [2.3.8] - 2023-03-18
332
333### Changed
334
335- Switch internal benchmarking code to benny.
336- Switch to TypeScript 5.x.x.
337- Switch rollup bundler plugins to core ones.
338- Switch to TSDoc syntax.
339- Enforce conventional commits.
340
341### Fixed
342
343- Fix random integer generator.
344- Fix worker choice strategy pool type identification at initialization.
345
346## [2.3.7] - 2022-10-23
347
348### Changed
349
350- Switch to open collective FOSS project funding platform.
351- Switch to ts-standard linter configuration on TypeScript code.
352
353### Fixed
354
355- Fixed missing async on pool execute method.
356- Fixed typing in TypeScript example.
357- Fixed types in unit tests.
358
359## [2.3.6] - 2022-10-22
360
361### Changed
362
363- Cleanup pool attributes and methods.
364- Refine error types thrown.
365
366### Fixed
367
368- Fix continuous integration build on windows.
369- Fix code coverage reporting by using c8 instead of nyc.
370
371## [2.3.5] - 2022-10-21
372
373### Changed
374
375- Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
376- Optimize tasks usage lookup implementation.
377
378### Fixed
379
380- Fix missed pool event emitter type export.
381- Fix typedoc documentation generation.
382
383## [2.3.4] - 2022-10-17
384
385### Added
386
387- Fully automate release process with release-it.
388
389### Changed
390
391- Optimize fair share task scheduling algorithm implementation.
392- Update benchmarks versus external pools results with latest version.
393
394## [2.3.3] - 2022-10-15
395
396### Added
397
398- Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
399
400## [2.3.2] - 2022-10-14
401
402### Changed
403
404- Optimize fair share worker selection strategy implementation.
405
406### Fixed
407
408- Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
409
410## [2.3.1] - 2022-10-13
411
412### Added
413
414- Pool worker choice strategies:
415 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
416 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
417
418## [2.2.2] - 2022-10-09
419
420### Fixed
421
422- Fixed `README.md` file.
423
424## [2.2.1] - 2022-10-08
425
426### Added
427
428- Dynamic worker choice strategy change at runtime.
429
430## [2.2.0] - 2022-01-05
431
432### Breaking Changes
433
434- Support only NodeJS version 16.x.x for cluster pool: upstream cluster API have changed on that version.
435
436## [2.1.0] - 2021-08-29
437
438### Added
439
440- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
441
442### Breaking Changes
443
444- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
445- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
446- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
447- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
448
449## [2.0.2] - 2021-05-12
450
451### Bug fixes
452
453- Fix `busy` event emission on fixed pool type
454
455## [2.0.1] - 2021-03-16
456
457### Bug fixes
458
459- Check if pool options are properly set.
460- `busy` event is emitted on all pool types.
461
462## [2.0.0] - 2021-03-01
463
464### Bug fixes
465
466- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
467
468### Breaking Changes
469
470- `FullPool` event is now renamed to `busy`.
471- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
472 _Find more details on our JSDoc._
473
474- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
475
476- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
477
478### Pool options types declaration merge
479
480`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
481
482#### New `export` strategy
483
484```js
485// Before
486const DynamicThreadPool = require('poolifier/lib/dynamic')
487// After
488const { DynamicThreadPool } = require('poolifier/lib/dynamic')
489```
490
491But you should always prefer just using
492
493```js
494const { DynamicThreadPool } = require('poolifier')
495```
496
497#### New type definitions for input data and response
498
499For cluster worker and worker-thread pools, you can now only send and receive serializable data.
500_This is not a limitation by poolifier but NodeJS._
501
502#### Public property replacements
503
504`numWorkers` property is now `numberOfWorkers`
505
506#### Internal (protected) properties and methods renaming
507
508These properties are not intended for end users
509
510- `id` => `nextMessageId`
511
512These methods are not intended for end users
513
514- `_chooseWorker` => `chooseWorker`
515- `_newWorker` => `createWorker`
516- `_execute` => `internalExecute`
517- `_chooseWorker` => `chooseWorker`
518- `_checkAlive` => `checkAlive`
519- `_run` => `run`
520- `_runAsync` => `runAsync`
521
522## [1.1.0] - 2020-05-21
523
524### Added
525
526- ThreadWorker support async functions as option
527- Various external library patches
528
529## [1.0.0] - 2020-01-24
530
531### Added
532
533- FixedThreadPool implementation
534- DynamicThreadPool implementation
535- WorkerThread implementation to improve developer experience