docs: add changelog entry
[poolifier.git] / CHANGELOG.md
CommitLineData
522eea03 1# Changelog
2
3All notable changes to this project will be documented in this file.
4
d4abc60a 5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
522eea03 6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
45a5a54c
JB
8## [Unreleased]
9
2b099bf7
JB
10### Added
11
12- Add kill handler to worker options allowing to execute custom code when worker is killed.
1a3e01ba 13- Add listTaskFunctions() method to pool API.
9aef1431 14- SMTP server pool example: nodemailer.
2b099bf7 15
5b726f72
JB
16## [2.6.25] - 2023-08-13
17
72855e92
JB
18### Added
19
3b311539 20- HTTP server pool examples: fastify-cluster, fastify-hybrid.
02999424 21- WebSocket server pool examples: ws-cluster, ws-hybrid.
72855e92 22
7aadd6e5
JB
23## [2.6.24] - 2023-08-12
24
7d91a8cd
JB
25### Added
26
27- Add array of transferable objects to the `execute()` method arguments.
02999424 28- WebSocket server pool examples: ws-worker_threads.
7d91a8cd 29
6b4263b4
JB
30## [2.6.23] - 2023-08-11
31
3d76750a 32### Fixed
8e0af894 33
3d76750a 34- Fix pool busyness semantic when tasks queueing is enabled: the pool is busy when the number of executing tasks on each worker has reached the maximum tasks concurrency per worker.
9606b474 35
3d76750a
JB
36### Added
37
38- HTTP client pool examples: fetch, node-fetch and axios with multiple task functions.
02999424 39- HTTP server pool examples: express-worker_threads, fastify-worker_threads.
3d76750a
JB
40
41## [2.6.22] - 2023-08-10
9606b474 42
3d76750a 43### Fixed
9606b474
JB
44
45- Add missing `types` field to package.json `exports`.
46
3d76750a
JB
47### Changed
48
49- Structure markdown documentation (PR #811).
50
d9647bdd
JB
51## [2.6.21] - 2023-08-03
52
2111ec12
JB
53### Changed
54
55- Improve code documentation.
56- Code refactoring and cleanup for better maintainability and readability.
57
5c30b9d9
JB
58## [2.6.20] - 2023-07-21
59
10ecf8fd
JB
60### Fixed
61
62- Fix queued tasks redistribution on error task execution starvation.
4e377863 63- Ensure task queueing per worker condition is untangled from the pool busyness semantic.
10ecf8fd 64
aa9eede8
JB
65### Changed
66
7c89e6a4 67- Drastically reduce lookups by worker in the worker nodes.
aa9eede8 68
62485908
JB
69## [2.6.19] - 2023-07-20
70
2e2ef9c3
JB
71### Added
72
73- Dedicated internal communication channel for worker_threads pools.
74
8f4c9491
JB
75## [2.6.18] - 2023-07-19
76
8660b972
JB
77### Changed
78
79- Code refactoring and cleanup for better maintainability and readability. Bundle size is a bit smaller.
80
206a3519
JB
81## [2.6.17] - 2023-07-16
82
b4899fae
JB
83### Added
84
1a3e01ba 85- Add `listTaskFunctions()` method to worker API.
b4899fae 86
58a06a6c
JB
87## [2.6.16] - 2023-07-12
88
2a69b8c5
JB
89### Fixed
90
80520ca4 91- Fix pool startup detection.
2a69b8c5
JB
92- Fix worker task functions handling.
93
b5900b02
JB
94## [2.6.15] - 2023-07-11
95
19dbc45b
JB
96### Added
97
98- Take into account worker node readiness in worker choice strategies.
99
4a0db581
JB
100## [2.6.14] - 2023-07-10
101
87e44747
JB
102### Fixed
103
104- Fix task function statistics tracking.
105
0265272f
JB
106## [2.6.13] - 2023-07-10
107
968a2e8c
JB
108### Added
109
110- Add per task function statistics tracking.
782299f8 111- Add public methods to manipulate the worker task functions at runtime.
968a2e8c 112
44c8c00f
JB
113## [2.6.12] - 2023-07-09
114
aa4bf4b2
JB
115### Fixed
116
117- Workaround import issue with `node:os` module in node 16.x.x.
118
b7cfced1
JB
119## [2.6.11] - 2023-07-09
120
d5024c00
JB
121### Fixed
122
123- Fix pool readiness semantic.
124
f313a208
JB
125## [2.6.10] - 2023-07-08
126
2431bdb4
JB
127### Fixed
128
129- Ensure workers are not recreated on error at pool startup.
130
131### Added
132
133- Add `ready` and `strategy` fields to pool information.
134- Add pool event `ready` to notify when the number of workers created in the pool has reached the maximum size expected and are ready.
caadbd41 135- Add dynamic pool sizing checks.
2431bdb4 136
369d0a51
JB
137## [2.6.9] - 2023-07-07
138
2845f2a5
JB
139### Fixed
140
141- Recreate the right worker type on uncaught exception.
142
143### Added
144
145- Add minimum and maximum to internal measurement statistics.
1dcf8b7b 146- Add `runTime` and `waitTime` to pool information.
75d3401a 147- Check worker inactive time only on dynamic worker.
2845f2a5 148
fc97d613
JB
149## [2.6.8] - 2023-07-03
150
92b1feaa
JB
151### Fixed
152
153- Brown paper bag release to fix version handling in pool information.
154
52d54060
JB
155## [2.6.7] - 2023-07-03
156
5bc91f3e
JB
157### Fixed
158
159- Ensure worker queued tasks at error are reassigned to other pool workers.
160
afe0d5bf
JB
161### Added
162
163- Add pool `utilization` ratio to pool information.
23ccf9d7 164- Add `version` to pool information.
e5b3047d 165- Add worker information to worker nodes.
afe0d5bf 166
f42c583f
JB
167## [2.6.6] - 2023-07-01
168
6961ca9a
JB
169### Added
170
171- Add safe helper `availableParallelism` to help sizing the pool.
172
3749facb
JB
173### Fixed
174
175- Ensure message handler is only registered in worker.
176
6fed2513
JB
177## [2.6.5] - 2023-06-27
178
c72f6987
JB
179### Known issues
180
70726c28 181- Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
c72f6987
JB
182
183### Fixed
184
185- Artificial version bump to 2.6.5 to workaround publication issue.
186- Ensure cluster pool destroy() gracefully shutdowns worker's server.
187- Ensure pool event is emitted before task error promise rejection.
188- Fix queued tasks count computation.
189
190### Removed
191
2fbe1783 192- Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
c72f6987 193
6426631b
JB
194## [2.6.4] - 2023-06-27
195
941f9a7c
JB
196### Known issues
197
70726c28 198- Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
941f9a7c 199
2c039e43
JB
200### Fixed
201
202- Ensure cluster pool destroy() gracefully shutdowns worker's server.
203- Ensure pool event is emitted before task error promise rejection.
9c16fb4b 204- Fix queued tasks count computation.
2c039e43 205
941f9a7c
JB
206### Removed
207
2fbe1783 208- Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
941f9a7c 209
bc1b0765
JB
210## [2.6.3] - 2023-06-19
211
a6a2dc4c
JB
212### Fixed
213
214- Ensure no tasks are queued when trying to soft kill a dynamic worker.
f0d7f803 215- Update strategies internals after statistics computation.
a6a2dc4c 216
7b56f532
JB
217### Changed
218
219- Optimize O(1) queue implementation.
220
b628596c
JB
221## [2.6.2] - 2023-06-12
222
a9e89d00
JB
223### Fixed
224
225- Fix new worker use after creation in dynamic pool given the current worker choice strategy.
226
4368a898
JB
227## [2.6.1] - 2023-06-10
228
931d43e2
JB
229### Added
230
13ab5b87 231- Add worker choice strategy documentation: [README.md](./docs/worker-choice-strategies.md).
931d43e2 232
f1c06930
JB
233### Fixed
234
235- Fix average statistics computation: ensure failed tasks are not accounted.
236
16671b07
JB
237## [2.6.0] - 2023-06-09
238
a1347286
JB
239### Added
240
5af9c0f7 241- Add `LEAST_ELU` worker choice strategy (experimental).
9adcefab 242- Add tasks ELU instead of runtime support to `FAIR_SHARE` worker choice strategy.
a1347286 243
1c6fe997
JB
244### Changed
245
246- Refactor pool worker node usage internals.
477f48e7 247- Breaking change: refactor worker choice strategy statistics requirements: the syntax of the worker choice strategy options has changed.
f63a9dda 248- Breaking change: pool information `info` property object fields have been renamed.
1c6fe997
JB
249
250### Fixed
251
252- Fix wait time accounting.
253- Ensure worker choice strategy `LEAST_BUSY` accounts also tasks wait time.
254- Ensure worker choice strategy `LEAST_USED` accounts also queued tasks.
255
aa07d6ee
JB
256## [2.5.4] - 2023-06-07
257
b6b32453
JB
258### Added
259
260- Add Event Loop Utilization (ELU) statistics to worker tasks usage.
261
262### Changed
263
264- Compute statistics at the worker level only if needed.
2fbe1783 265- Add `worker_threads` options to thread pool options.
b6b32453 266
272d4d8f
JB
267### Fixed
268
269- Make the `LEAST_BUSY` strategy only relies on task runtime.
270
ed47fb3d
JB
271## [2.5.3] - 2023-06-04
272
89a4abfd
JB
273### Changed
274
275- Refine pool information content.
b4213b7f 276- Limit pool internals public exposure.
89a4abfd 277
8a9febf5
JB
278## [2.5.2] - 2023-06-02
279
91ee39ed
JB
280### Added
281
282- Add `taskError` pool event for task execution error.
6b27d407 283- Add pool information `info` property to pool.
91ee39ed
JB
284- Emit pool information on `busy` and `full` pool events.
285
8babb151
JB
286## [2.5.1] - 2023-06-01
287
0e05c4dc
JB
288### Added
289
1f68cede 290- Add pool option `restartWorkerOnError` to restart worker on uncaught error. Default to `true`.
91ee39ed 291- Add `error` pool event for uncaught worker error.
0e05c4dc 292
a8766181
JB
293## [2.5.0] - 2023-05-31
294
e4543b14
JB
295### Added
296
297- Switch pool event emitter to `EventEmitterAsyncResource`.
6da80d38 298- Add tasks wait time accounting in per worker tasks usage.
5af9c0f7 299- Add interleaved weighted round robin `INTERLEAVED_WEIGHTED_ROUND_ROBIN` worker choice strategy (experimental).
e4543b14
JB
300
301### Changed
302
303- Renamed worker choice strategy `LESS_BUSY` to `LEAST_BUSY` and `LESS_USED` to `LEAST_USED`.
304
570efb11
JB
305## [2.4.14] - 2023-05-09
306
b0f28bad
JB
307### Fixed
308
309- Ensure no undefined task runtime can land in the tasks history.
310- Fix median computation implementation once again.
311
110b6d13
JB
312### Added
313
314- Unit tests for median and queue implementations.
315
72584880
JB
316## [2.4.13] - 2023-05-08
317
b0d6ed8f
JB
318### Fixed
319
e3058615 320- Fix worker choice strategy options validation.
b0d6ed8f
JB
321- Fix fair share worker choice strategy internals update: ensure virtual task end timestamp is computed at task submission.
322
06140c32
JB
323## [2.4.12] - 2023-05-06
324
a86b6df1
JB
325### Added
326
327- Support multiple task functions per worker.
08f3f44c 328- Add custom worker weights support to worker choice strategies options.
a86b6df1 329
29ee7e9a
JB
330### Changed
331
332- Use O(1) queue implementation for tasks queueing.
333
0682ba15
JB
334### Fixed
335
336- Fix median computation implementation.
337- Fix fair share worker choice strategy internals update.
338
936d53ec
JB
339## [2.4.11] - 2023-04-23
340
cb70b19d
JB
341### Changed
342
343- Optimize free worker finding in worker choice strategies.
344
15bb637a
JB
345## [2.4.10] - 2023-04-15
346
ef41a6e6
JB
347### Fixed
348
82ea6492 349- Fix typescript type definition for task function: ensure the input data is optional.
ef41a6e6
JB
350- Fix typescript type definition for pool execute(): ensure the input data is optional.
351
181eb2b4
JB
352## [2.4.9] - 2023-04-15
353
a20f0ba5
JB
354### Added
355
356- Add tasks queue enablement runtime setter to pool.
357- Add tasks queue options runtime setter to pool.
358- Add worker choice strategy options runtime setter to pool.
359
360### Changed
361
362- Remove the tasks queuing experimental status.
363
d4aeae5a
JB
364### Fixed
365
82ea6492 366- Fix task function type definition and validation.
2fc5cae3 367- Fix worker choice strategy options handling.
d4aeae5a 368
1d9e7023
JB
369## [2.4.8] - 2023-04-12
370
f9b4bbf8
JB
371### Fixed
372
373- Fix message between main worker and worker type definition for tasks.
374- Fix code documentation.
375
12ae3210
JB
376## [2.4.7] - 2023-04-11
377
7171d33f
JB
378### Added
379
380- Add worker tasks queue options to pool options.
381
e8bd29ce
JB
382### Fixed
383
384- Fix missing documentation.
385
42c7bc10
JB
386## [2.4.6] - 2023-04-10
387
681196cc
JB
388### Fixed
389
390- Ensure one task at a time is executed per worker with tasks queueing enabled.
1c6fe997 391- Properly count worker executing tasks with tasks queueing enabled.
681196cc 392
54d360e3
JB
393## [2.4.5] - 2023-04-09
394
3fafb1b2
JB
395### Added
396
9e775f96
JB
397- Use monotonic high resolution timer for worker tasks runtime.
398- Add worker tasks median runtime to statistics.
ff733df7 399- Add worker tasks queue (experimental).
3fafb1b2 400
92fa3eb6
JB
401## [2.4.4] - 2023-04-07
402
aee46736
JB
403### Added
404
405- Add `PoolEvents` enumeration and `PoolEvent` type.
406
36b5e78f
JB
407### Fixed
408
ff0c2b3e 409- Destroy worker only on alive check.
36b5e78f 410
9fb0f324
JB
411## [2.4.3] - 2023-04-07
412
28cf3617
JB
413### Fixed
414
415- Fix typedoc generation with inheritance.
416
848f0f27
JB
417## [2.4.2] - 2023-04-06
418
164d950a
JB
419### Added
420
421- Add `full` event to dynamic pool.
32417142 422- Keep worker choice strategy in memory for conditional reuse.
164d950a 423
78ab2555
JB
424### Fixed
425
426- Fix possible negative worker key at worker removal in worker choice strategies.
427
79aafe9f
JB
428## [2.4.1] - 2023-04-05
429
9cd39dd4
JB
430### Changed
431
432- Optimize worker choice strategy for dynamic pool.
433
965415bb
JB
434### Fixed
435
436- Ensure dynamic pool does not alter worker choice strategy expected behavior.
437
d8b60b1c
JB
438## [2.4.0] - 2023-04-04
439
c6bd2650
JB
440### Added
441
442- Add `LESS_BUSY` worker choice strategy.
443
444### Changed
445
446- Optimize worker storage in pool.
447- Optimize worker alive status check.
448- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
449- Optimize `LESS_USED` worker choice strategy.
450- Update benchmarks versus external threads pools.
451- Optimize tasks usage statistics requirements for worker choice strategy.
452
453### Fixed
454
455- Ensure trimmable characters are checked at pool initialization.
456- Fix message id integer overflow.
457- Fix pool worker removal in worker choice strategy internals.
458- Fix package publication with pnpm.
459
d0a3f018
JB
460## [2.4.0-3] - 2023-04-04
461
b2ede285
JB
462### Added
463
464- Add `LESS_BUSY` worker choice strategy.
465
466### Changed
467
468- Optimize worker storage in pool.
469- Optimize worker alive status check.
470- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
471- Optimize `LESS_USED` worker choice strategy.
472- Update benchmarks versus external threads pools.
473
474### Fixed
475
476- Ensure trimmable characters are checked at pool initialization.
477- Fix message id integer overflow.
478- Fix pool worker removal in worker choice strategy internals.
479- Fix package publication with pnpm.
480
a015ea40
JB
481## [2.4.0-2] - 2023-04-03
482
698f4bbc
JB
483### Added
484
485- Add `LESS_BUSY` worker choice strategy.
486
487### Changed
488
489- Optimize worker storage in pool.
490- Optimize worker alive status check.
491- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
492- Optimize `LESS_USED` worker choice strategy.
493
494### Fixed
495
496- Ensure trimmable characters are checked at pool initialization.
497- Fix message id integer overflow.
498- Fix pool worker removal in worker choice strategy internals.
499- Fix package publication with pnpm.
500
8fe15920
JB
501## [2.4.0-1] - 2023-04-03
502
5b301c28
JB
503### Added
504
505- Add `LESS_BUSY` worker choice strategy.
506
507### Changed
508
509- Optimize worker storage in pool.
510- Optimize worker alive status check.
511- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
512- Optimize `LESS_USED` worker choice strategy.
513
514### Fixed
515
516- Ensure trimmable characters are checked at pool initialization.
517- Fix message id integer overflow.
518- Fix pool worker removal in worker choice strategy internals.
519
2fb9ca9c
JB
520## [2.4.0-0] - 2023-04-03
521
168c526f
JB
522### Added
523
524- Add `LESS_BUSY` worker choice strategy.
525
1d71a908
JB
526### Changed
527
ffcbbad8 528- Optimize worker storage in pool.
1d71a908 529- Optimize worker alive status check.
65a60b3b 530- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
737c6d97 531- Optimize `LESS_USED` worker choice strategy.
1d71a908 532
ffcbbad8
JB
533### Fixed
534
535- Ensure trimmable characters are checked at pool initialization.
b4e75778 536- Fix message id integer overflow.
97a2abc3 537- Fix pool worker removal in worker choice strategy internals.
ffcbbad8 538
08372738
JB
539## [2.3.10] - 2023-03-18
540
710826bc
JB
541### Fixed
542
9606b474 543- Fix package.json `exports` syntax for ESM and CommonJS.
710826bc
JB
544
545### Changed
546
547- Permit SemVer pre-release publication.
76e5ac6f 548
e4796ecd
JB
549## [2.3.10-2] - 2023-03-18
550
6abad580
JB
551### Fixed
552
9606b474 553- Fix package.json `exports` syntax for ESM and CommonJS.
6abad580 554
a2ee98cc
JB
555## [2.3.10-1] - 2023-03-18
556
7e060cee
JB
557### Changed
558
90483887 559- Permit SemVer pre-release publication.
7e060cee 560
c81bfafb
JB
561## [2.3.10-0] - 2023-03-18
562
fe18768d
JB
563### Fixed
564
9606b474 565- Fix package.json `exports` syntax for ESM and CommonJS.
fe18768d 566
d7b78217
JB
567## [2.3.9] - 2023-03-18
568
ed6dd37f
JB
569### Changed
570
571- Introduce ESM module support along with CommonJS one.
572
573### Fixed
574
575- Fix brown paper bag bug referencing the same object literal.
576
68e2ad86
JB
577## [2.3.8] - 2023-03-18
578
ca6c7d70
JB
579### Changed
580
581- Switch internal benchmarking code to benny.
fbdedeb9
JB
582- Switch to TypeScript 5.x.x.
583- Switch rollup bundler plugins to core ones.
ed6dd37f 584- Switch to TSDoc syntax.
fbdedeb9 585- Enforce conventional commits.
ca6c7d70 586
d15211d4
JB
587### Fixed
588
589- Fix random integer generator.
fbdedeb9 590- Fix worker choice strategy pool type identification at initialization.
d15211d4 591
995705ea
JB
592## [2.3.7] - 2022-10-23
593
b953022b
JB
594### Changed
595
596- Switch to open collective FOSS project funding platform.
78cea37e
JB
597- Switch to ts-standard linter configuration on TypeScript code.
598
599### Fixed
600
601- Fixed missing async on pool execute method.
602- Fixed typing in TypeScript example.
603- Fixed types in unit tests.
b953022b 604
3b9f6953
JB
605## [2.3.6] - 2022-10-22
606
f80cead4
JB
607### Changed
608
609- Cleanup pool attributes and methods.
610- Refine error types thrown.
611
612### Fixed
613
614- Fix continuous integration build on windows.
615- Fix code coverage reporting by using c8 instead of nyc.
616
efc22107
JB
617## [2.3.5] - 2022-10-21
618
7a6a0a96
JB
619### Changed
620
a05c10de
JB
621- Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
622- Optimize tasks usage lookup implementation.
7a6a0a96 623
b4904890
JB
624### Fixed
625
626- Fix missed pool event emitter type export.
627- Fix typedoc documentation generation.
628
a875f8d1
JB
629## [2.3.4] - 2022-10-17
630
73cda448
JB
631### Added
632
633- Fully automate release process with release-it.
634
45a5a54c
JB
635### Changed
636
73cda448 637- Optimize fair share task scheduling algorithm implementation.
eb4a8a82 638- Update benchmarks versus external pools results with latest version.
45a5a54c 639
90ee1b18 640## [2.3.3] - 2022-10-15
1a76932b
JB
641
642### Added
643
644- Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
645
90ee1b18 646## [2.3.2] - 2022-10-14
11df3590
JB
647
648### Changed
649
650- Optimize fair share worker selection strategy implementation.
651
652### Fixed
653
654- Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
655
90ee1b18 656## [2.3.1] - 2022-10-13
23ff945a
JB
657
658### Added
659
660- Pool worker choice strategies:
661 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
662 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
663
90ee1b18 664## [2.2.2] - 2022-10-09
cb2b6c69
JB
665
666### Fixed
667
668- Fixed `README.md` file.
669
90ee1b18 670## [2.2.1] - 2022-10-08
bdacc2d2 671
bdaf31cd
JB
672### Added
673
674- Dynamic worker choice strategy change at runtime.
bdacc2d2 675
90ee1b18 676## [2.2.0] - 2022-01-05
7e0d447f
JB
677
678### Breaking Changes
679
9606b474 680- Support only Node.js version 16.x.x for cluster pool: upstream cluster API have changed on that version.
7e0d447f 681
90ee1b18 682## [2.1.0] - 2021-08-29
35cf1c03
JB
683
684### Added
685
686- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
e088a00c
JB
687
688### Breaking Changes
689
690- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
691- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
692- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
c365b2d3 693- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
e088a00c 694
90ee1b18 695## [2.0.2] - 2021-05-12
14916bf9
JB
696
697### Bug fixes
698
699- Fix `busy` event emission on fixed pool type
700
90ee1b18 701## [2.0.1] - 2021-03-16
7f685093
JB
702
703### Bug fixes
704
705- Check if pool options are properly set.
706- `busy` event is emitted on all pool types.
707
90ee1b18 708## [2.0.0] - 2021-03-01
fa0f5b28 709
f3f833ab 710### Bug fixes
d63d3be3 711
ddbeaffd 712- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
d63d3be3 713
fa0f5b28
S
714### Breaking Changes
715
7f685093 716- `FullPool` event is now renamed to `busy`.
1927ee67 717- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
1a81f8af 718 _Find more details on our JSDoc._
ddbeaffd 719
1927ee67
APA
720- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
721
ddbeaffd 722- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
fa0f5b28 723
ec2ccfc8
JB
724### Pool options types declaration merge
725
726`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
727
fa0f5b28
S
728#### New `export` strategy
729
730```js
731// Before
1a3e01ba 732const DynamicThreadPool = require("poolifier/lib/dynamic");
fa0f5b28 733// After
1a3e01ba 734const { DynamicThreadPool } = require("poolifier/lib/dynamic");
fa0f5b28
S
735```
736
737But you should always prefer just using
738
739```js
1a3e01ba 740const { DynamicThreadPool } = require("poolifier");
fa0f5b28
S
741```
742
d3c8a1a8
S
743#### New type definitions for input data and response
744
6677a3d3 745For cluster worker and worker-thread pools, you can now only send and receive structured-cloneable data.
9606b474 746_This is not a limitation by poolifier but Node.js._
d3c8a1a8 747
3a4b605f 748#### Public property replacements
5c5a1fb7 749
3a4b605f 750`numWorkers` property is now `numberOfWorkers`
5c5a1fb7 751
280c2a77 752#### Internal (protected) properties and methods renaming
fa0f5b28 753
280c2a77
S
754These properties are not intended for end users
755
756- `id` => `nextMessageId`
757
758These methods are not intended for end users
fa0f5b28
S
759
760- `_chooseWorker` => `chooseWorker`
280c2a77 761- `_newWorker` => `createWorker`
fa0f5b28
S
762- `_execute` => `internalExecute`
763- `_chooseWorker` => `chooseWorker`
764- `_checkAlive` => `checkAlive`
765- `_run` => `run`
766- `_runAsync` => `runAsync`
767
90ee1b18 768## [1.1.0] - 2020-05-21
0312f71a
APA
769
770### Added
771
772- ThreadWorker support async functions as option
cf9aa6c3 773- Various external library patches
0312f71a 774
90ee1b18 775## [1.0.0] - 2020-01-24
522eea03 776
777### Added
778
779- FixedThreadPool implementation
780- DynamicThreadPool implementation
0312f71a 781- WorkerThread implementation to improve developer experience