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