Apply dependencies update. (#369)
[poolifier.git] / CHANGELOG.md
CommitLineData
522eea03 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.0.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
e088a00c
JB
8## [2.1.0] - 2021-dd-mm
9
10### Breaking Changes
11
12- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
13- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
14- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
15
d7a0c5c5 16## [2.0.2] - 2021-12-05
14916bf9
JB
17
18### Bug fixes
19
20- Fix `busy` event emission on fixed pool type
21
59af1281 22## [2.0.1] - 2021-16-03
7f685093
JB
23
24### Bug fixes
25
26- Check if pool options are properly set.
27- `busy` event is emitted on all pool types.
28
3695a6b0 29## [2.0.0] - 2021-01-03
fa0f5b28 30
f3f833ab 31### Bug fixes
d63d3be3 32
ddbeaffd 33- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
d63d3be3 34
fa0f5b28
S
35### Breaking Changes
36
7f685093 37- `FullPool` event is now renamed to `busy`.
1927ee67 38- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
1a81f8af 39 _Find more details on our JSDoc._
ddbeaffd 40
1927ee67
APA
41- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
42
ddbeaffd 43- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
fa0f5b28 44
ec2ccfc8
JB
45### Pool options types declaration merge
46
47`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
48
fa0f5b28
S
49#### New `export` strategy
50
51```js
52// Before
777b7824 53const DynamicThreadPool = require('poolifier/lib/dynamic')
fa0f5b28 54// After
777b7824 55const { DynamicThreadPool } = require('poolifier/lib/dynamic')
fa0f5b28
S
56```
57
58But you should always prefer just using
59
60```js
777b7824 61const { DynamicThreadPool } = require('poolifier')
fa0f5b28
S
62```
63
d3c8a1a8
S
64#### New type definitions for input data and response
65
ec2ccfc8 66For cluster worker and worker-thread pools, you can now only send and receive serializable data.
d3c8a1a8
S
67_This is not a limitation by poolifier but NodeJS._
68
3a4b605f 69#### Public property replacements
5c5a1fb7 70
3a4b605f 71`numWorkers` property is now `numberOfWorkers`
5c5a1fb7 72
280c2a77 73#### Internal (protected) properties and methods renaming
fa0f5b28 74
280c2a77
S
75These properties are not intended for end users
76
77- `id` => `nextMessageId`
78
79These methods are not intended for end users
fa0f5b28
S
80
81- `_chooseWorker` => `chooseWorker`
280c2a77 82- `_newWorker` => `createWorker`
fa0f5b28
S
83- `_execute` => `internalExecute`
84- `_chooseWorker` => `chooseWorker`
85- `_checkAlive` => `checkAlive`
86- `_run` => `run`
87- `_runAsync` => `runAsync`
88
0312f71a
APA
89## [1.1.0] - 2020-21-05
90
91### Added
92
93- ThreadWorker support async functions as option
cf9aa6c3 94- Various external library patches
0312f71a 95
522eea03 96## [1.0.0] - 2020-24-01
97
98### Added
99
100- FixedThreadPool implementation
101- DynamicThreadPool implementation
0312f71a 102- WorkerThread implementation to improve developer experience