Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/fastify-worker_thr...
[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### Fixed
11
12- Fix task stealing related tasks queue options handling at runtime.
13
14### Changed
15
16- Stricter worker constructor arguments validation.
17
18## [2.6.45] - 2023-09-17
19
20### Changed
21
22- Disable publication on GitHub packages registry on release until authentication issue is fixed.
23
24### Added
25
26- Add `startWorkers` to pool options to whether start the minimum number of workers at pool creation or not.
27- Add `start()` method to pool API to start the minimum number of workers.
28- Add `taskStealing` and `tasksStealingOnPressure` to tasks queue options to whether enable task stealing or not and whether enable tasks stealing on back pressure or not.
29- Continuous internal benchmarking: https://poolifier.github.io/benchmark-results/dev/bench.
30
31## [2.6.44] - 2023-09-08
32
33### Fixed
34
35- Use a dedicated PAT to publish on GitHub packages registry.
36
37### Added
38
39- Publish on GitHub packages registry on release.
40
41### Changed
42
43- Switch from rome to biome: [PR #1128](https://github.com/poolifier/poolifier/pull/1128).
44
45## [2.6.43] - 2023-09-08
46
47### Added
48
49- Publish on GitHub packages registry on release.
50
51### Changed
52
53- Switch from rome to biome: [PR #1128](https://github.com/poolifier/poolifier/pull/1128).
54
55## [2.6.42] - 2023-09-06
56
57### Changed
58
59- Optimize hot code paths implementation: avoid unnecessary branching, add and use optimized helpers (min, max), use reduce() array helper, ...
60
61## [2.6.41] - 2023-09-03
62
63### Changed
64
65- Optimize worker choice strategies implementation.
66
67## [2.6.40] - 2023-09-01
68
69### Fixed
70
71- Do not pre-choose in WRR worker choice strategy to avoid bias.
72- Avoid array out of bound in worker choice strategies after worker node removal.
73
74## [2.6.39] - 2023-08-30
75
76### Fixed
77
78- Fix race condition in worker choice strategies at worker node info querying while not yet initialized.
79
80## [2.6.38] - 2023-08-30
81
82### Added
83
84- Bundle typescript types declaration into one file.
85
86### Changed
87
88- Improve interleaved weighted round robin worker choice strategy implementation.
89
90## [2.6.37] - 2023-08-28
91
92### Fixed
93
94- Ensure unused worker usage statistics are deleted at runtime.
95
96### Changed
97
98- Rename worker choice strategy options `choiceRetries` to `retries`.
99- Avoid unnecessary branching in worker choice strategies.
100
101## [2.6.36] - 2023-08-27
102
103### Fixed
104
105- Fix pool `execute()` arguments check.
106
107### Changed
108
109- Make continuous tasks stealing algorithm less aggressive.
110- Fine tune tasks stealing algorithm under back pressure.
111
112## [2.6.35] - 2023-08-25
113
114### Fixed
115
116- Don't account worker usage statistics for tasks that have failed.
117- Fix pool information runtime and wait time median computation.
118
119### Changed
120
121- Update simple moving average implementation to use a circular buffer.
122- Update simple moving median implementation to use a circular buffer.
123- Account for stolen tasks in worker usage statistics and pool information.
124
125### Added
126
127- Continuous tasks stealing algorithm.
128
129## [2.6.34] - 2023-08-24
130
131### Fixes
132
133- Avoid cascading tasks stealing under back pressure.
134
135### Changed
136
137- Add fastpath to queued tasks rescheduling.
138
139## [2.6.33] - 2023-08-24
140
141### Fixed
142
143- Fix queued tasks rescheduling.
144
145### Changed
146
147- Rename tasks queue options `queueMaxSize` to `size`.
148
149### Added
150
151- Task stealing scheduling algorithm if tasks queueing is enabled.
152
153## [2.6.32] - 2023-08-23
154
155### Fixed
156
157- Ensure no task can be executed when the pool is destroyed.
158
159### Added
160
161- Add `queueMaxSize` option to tasks queue options.
162- Add O(1) deque implementation implemented with doubly linked list and use it for tasks queueing.
163- Add tasks stealing algorithm when a worker node queue is back pressured if tasks queueing is enabled.
164
165## [2.6.31] - 2023-08-20
166
167### Fixed
168
169- Fix worker choice strategy retries mechanism in some edge cases.
170
171### Changed
172
173- Make orthogonal worker choice strategies tasks distribution and created dynamic worker usage.
174- Remove the experimental status of the `LEAST_ELU` worker choice strategy.
175
176## [2.6.30] - 2023-08-19
177
178### Fixed
179
180- Ensure pool event `backPressure` is emitted.
181- Ensure pool event `full` is emitted only once.
182- Ensure worker node cannot be instantiated without proper arguments.
183
184## [2.6.29] - 2023-08-18
185
186### Fixed
187
188- Fix race condition between ready and task functions worker message handling at startup.
189- Fix duplicate task function worker usage statistics computation per task function.
190- Update task function worker usage statistics if and only if there's at least two different task functions.
191- Fix race condition at task function worker usage executing task computation leading to negative value.
192
193### Added
194
195- Add back pressure detection on the worker node queue. Event `backPressure` is emitted when all worker node queues are full (worker node queue size >= poolMaxSize^2).
196- Use back pressure detection in worker choice strategies.
197- Add worker choice strategies retries mechanism if no worker is eligible.
198
199## [2.6.28] - 2023-08-16
200
201### Fixed
202
203- Ensure pool workers are properly initialized.
204
205### Added
206
207- HTTP server pool examples: express-cluster, express-hybrid.
208
209### Changed
210
211- Remove now useless branching in worker hot code path.
212
213## [2.6.27] - 2023-08-15
214
215### Fixed
216
217- Add `KillHandler` type definition to exported types.
218
219### Added
220
221- Add `destroy` event to pool API.
222
223## [2.6.26] - 2023-08-15
224
225### Added
226
227- Add kill handler to worker options allowing to execute custom code when worker is killed.
228- Add `listTaskFunctions()` method to pool API.
229- SMTP client pool example: nodemailer.
230
231## [2.6.25] - 2023-08-13
232
233### Added
234
235- HTTP server pool examples: fastify-cluster, fastify-hybrid.
236- WebSocket server pool examples: ws-cluster, ws-hybrid.
237
238## [2.6.24] - 2023-08-12
239
240### Added
241
242- Add array of transferable objects to the `execute()` method arguments.
243- WebSocket server pool examples: ws-worker_threads.
244
245## [2.6.23] - 2023-08-11
246
247### Fixed
248
249- 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.
250
251### Added
252
253- HTTP client pool examples: fetch, node-fetch and axios with multiple task functions.
254- HTTP server pool examples: express-worker_threads, fastify-worker_threads.
255
256## [2.6.22] - 2023-08-10
257
258### Fixed
259
260- Add missing `types` field to package.json `exports`.
261
262### Changed
263
264- Structure markdown documentation (PR #811).
265
266## [2.6.21] - 2023-08-03
267
268### Changed
269
270- Improve code documentation.
271- Code refactoring and cleanup for better maintainability and readability.
272
273## [2.6.20] - 2023-07-21
274
275### Fixed
276
277- Fix queued tasks redistribution on error task execution starvation.
278- Ensure tasks queueing per worker condition is untangled from the pool busyness semantic.
279
280### Changed
281
282- Drastically reduce lookups by worker in the worker nodes.
283
284## [2.6.19] - 2023-07-20
285
286### Added
287
288- Dedicated internal communication channel for worker_threads pools.
289
290## [2.6.18] - 2023-07-19
291
292### Changed
293
294- Code refactoring and cleanup for better maintainability and readability. Bundle size is a bit smaller.
295
296## [2.6.17] - 2023-07-16
297
298### Added
299
300- Add `listTaskFunctions()` method to worker API.
301
302## [2.6.16] - 2023-07-12
303
304### Fixed
305
306- Fix pool startup detection.
307- Fix worker task functions handling.
308
309## [2.6.15] - 2023-07-11
310
311### Added
312
313- Take into account worker node readiness in worker choice strategies.
314
315## [2.6.14] - 2023-07-10
316
317### Fixed
318
319- Fix task function statistics tracking.
320
321## [2.6.13] - 2023-07-10
322
323### Added
324
325- Add per task function statistics tracking.
326- Add public methods to manipulate the worker task functions at runtime.
327
328## [2.6.12] - 2023-07-09
329
330### Fixed
331
332- Workaround import issue with `node:os` module in node 16.x.x.
333
334## [2.6.11] - 2023-07-09
335
336### Fixed
337
338- Fix pool readiness semantic.
339
340## [2.6.10] - 2023-07-08
341
342### Fixed
343
344- Ensure workers are not recreated on error at pool startup.
345
346### Added
347
348- Add `ready` and `strategy` fields to pool information.
349- Add pool event `ready` to notify when the number of workers created in the pool has reached the maximum size expected and are ready.
350- Add dynamic pool sizing checks.
351
352## [2.6.9] - 2023-07-07
353
354### Fixed
355
356- Recreate the right worker type on uncaught exception.
357
358### Added
359
360- Add minimum and maximum to internal measurement statistics.
361- Add `runTime` and `waitTime` to pool information.
362- Check worker inactive time only on dynamic worker.
363
364## [2.6.8] - 2023-07-03
365
366### Fixed
367
368- Brown paper bag release to fix version handling in pool information.
369
370## [2.6.7] - 2023-07-03
371
372### Fixed
373
374- Ensure worker queued tasks at error are reassigned to other pool workers.
375
376### Added
377
378- Add pool `utilization` ratio to pool information.
379- Add `version` to pool information.
380- Add worker information to worker nodes.
381
382## [2.6.6] - 2023-07-01
383
384### Added
385
386- Add safe helper `availableParallelism()` to help sizing the pool.
387
388### Fixed
389
390- Ensure message handler is only registered in worker.
391
392## [2.6.5] - 2023-06-27
393
394### Known issues
395
396- Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
397
398### Fixed
399
400- Artificial version bump to 2.6.5 to workaround publication issue.
401- Ensure cluster pool `destroy()` gracefully shutdowns worker's server.
402- Ensure pool event is emitted before task error promise rejection.
403- Fix queued tasks count computation.
404
405### Removed
406
407- Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
408
409## [2.6.4] - 2023-06-27
410
411### Known issues
412
413- Cluster pools tasks execution are not working by using ESM files extension: https://github.com/poolifier/poolifier/issues/782
414
415### Fixed
416
417- Ensure cluster pool `destroy()` gracefully shutdowns worker's server.
418- Ensure pool event is emitted before task error promise rejection.
419- Fix queued tasks count computation.
420
421### Removed
422
423- Remove unneeded worker_threads worker `MessageChannel` internal usage for IPC.
424
425## [2.6.3] - 2023-06-19
426
427### Fixed
428
429- Ensure no tasks are queued when trying to soft kill a dynamic worker.
430- Update strategies internals after statistics computation.
431
432### Changed
433
434- Optimize O(1) queue implementation.
435
436## [2.6.2] - 2023-06-12
437
438### Fixed
439
440- Fix new worker use after creation in dynamic pool given the current worker choice strategy.
441
442## [2.6.1] - 2023-06-10
443
444### Added
445
446- Add worker choice strategy documentation: [README.md](./docs/worker-choice-strategies.md).
447
448### Fixed
449
450- Fix average statistics computation: ensure failed tasks are not accounted.
451
452## [2.6.0] - 2023-06-09
453
454### Added
455
456- Add `LEAST_ELU` worker choice strategy (experimental).
457- Add tasks ELU instead of runtime support to `FAIR_SHARE` worker choice strategy.
458
459### Changed
460
461- Refactor pool worker node usage internals.
462- Breaking change: refactor worker choice strategy statistics requirements: the syntax of the worker choice strategy options has changed.
463- Breaking change: pool information `info` property object fields have been renamed.
464
465### Fixed
466
467- Fix wait time accounting.
468- Ensure worker choice strategy `LEAST_BUSY` accounts also tasks wait time.
469- Ensure worker choice strategy `LEAST_USED` accounts also queued tasks.
470
471## [2.5.4] - 2023-06-07
472
473### Added
474
475- Add Event Loop Utilization (ELU) statistics to worker tasks usage.
476
477### Changed
478
479- Compute statistics at the worker level only if needed.
480- Add `worker_threads` options to thread pool options.
481
482### Fixed
483
484- Make the `LEAST_BUSY` strategy only relies on task runtime.
485
486## [2.5.3] - 2023-06-04
487
488### Changed
489
490- Refine pool information content.
491- Limit pool internals public exposure.
492
493## [2.5.2] - 2023-06-02
494
495### Added
496
497- Add `taskError` pool event for task execution error.
498- Add pool information `info` property to pool.
499- Emit pool information on `busy` and `full` pool events.
500
501## [2.5.1] - 2023-06-01
502
503### Added
504
505- Add pool option `restartWorkerOnError` to restart worker on uncaught error. Default to `true`.
506- Add `error` pool event for uncaught worker error.
507
508## [2.5.0] - 2023-05-31
509
510### Added
511
512- Switch pool event emitter to `EventEmitterAsyncResource`.
513- Add tasks wait time accounting in per worker tasks usage.
514- Add interleaved weighted round robin `INTERLEAVED_WEIGHTED_ROUND_ROBIN` worker choice strategy (experimental).
515
516### Changed
517
518- Renamed worker choice strategy `LESS_BUSY` to `LEAST_BUSY` and `LESS_USED` to `LEAST_USED`.
519
520## [2.4.14] - 2023-05-09
521
522### Fixed
523
524- Ensure no undefined task runtime can land in the tasks history.
525- Fix median computation implementation once again.
526
527### Added
528
529- Unit tests for median and queue implementations.
530
531## [2.4.13] - 2023-05-08
532
533### Fixed
534
535- Fix worker choice strategy options validation.
536- Fix fair share worker choice strategy internals update: ensure virtual task end timestamp is computed at task submission.
537
538## [2.4.12] - 2023-05-06
539
540### Added
541
542- Support multiple task functions per worker.
543- Add custom worker weights support to worker choice strategies options.
544
545### Changed
546
547- Use O(1) queue implementation for tasks queueing.
548
549### Fixed
550
551- Fix median computation implementation.
552- Fix fair share worker choice strategy internals update.
553
554## [2.4.11] - 2023-04-23
555
556### Changed
557
558- Optimize free worker finding in worker choice strategies.
559
560## [2.4.10] - 2023-04-15
561
562### Fixed
563
564- Fix typescript type definition for task function: ensure the input data is optional.
565- Fix typescript type definition for pool execute(): ensure the input data is optional.
566
567## [2.4.9] - 2023-04-15
568
569### Added
570
571- Add tasks queue enablement runtime setter to pool.
572- Add tasks queue options runtime setter to pool.
573- Add worker choice strategy options runtime setter to pool.
574
575### Changed
576
577- Remove the tasks queuing experimental status.
578
579### Fixed
580
581- Fix task function type definition and validation.
582- Fix worker choice strategy options handling.
583
584## [2.4.8] - 2023-04-12
585
586### Fixed
587
588- Fix message between main worker and worker type definition for tasks.
589- Fix code documentation.
590
591## [2.4.7] - 2023-04-11
592
593### Added
594
595- Add worker tasks queue options to pool options.
596
597### Fixed
598
599- Fix missing documentation.
600
601## [2.4.6] - 2023-04-10
602
603### Fixed
604
605- Ensure one task at a time is executed per worker with tasks queueing enabled.
606- Properly count worker executing tasks with tasks queueing enabled.
607
608## [2.4.5] - 2023-04-09
609
610### Added
611
612- Use monotonic high resolution timer for worker tasks runtime.
613- Add worker tasks median runtime to statistics.
614- Add worker tasks queue (experimental).
615
616## [2.4.4] - 2023-04-07
617
618### Added
619
620- Add `PoolEvents` enumeration and `PoolEvent` type.
621
622### Fixed
623
624- Destroy worker only on alive check.
625
626## [2.4.3] - 2023-04-07
627
628### Fixed
629
630- Fix typedoc generation with inheritance.
631
632## [2.4.2] - 2023-04-06
633
634### Added
635
636- Add `full` event to dynamic pool.
637- Keep worker choice strategy in memory for conditional reuse.
638
639### Fixed
640
641- Fix possible negative worker key at worker removal in worker choice strategies.
642
643## [2.4.1] - 2023-04-05
644
645### Changed
646
647- Optimize worker choice strategy for dynamic pool.
648
649### Fixed
650
651- Ensure dynamic pool does not alter worker choice strategy expected behavior.
652
653## [2.4.0] - 2023-04-04
654
655### Added
656
657- Add `LESS_BUSY` worker choice strategy.
658
659### Changed
660
661- Optimize worker storage in pool.
662- Optimize worker alive status check.
663- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
664- Optimize `LESS_USED` worker choice strategy.
665- Update benchmark versus external threads pools.
666- Optimize tasks usage statistics requirements for worker choice strategy.
667
668### Fixed
669
670- Ensure trimmable characters are checked at pool initialization.
671- Fix message id integer overflow.
672- Fix pool worker removal in worker choice strategy internals.
673- Fix package publication with pnpm.
674
675## [2.4.0-3] - 2023-04-04
676
677### Added
678
679- Add `LESS_BUSY` worker choice strategy.
680
681### Changed
682
683- Optimize worker storage in pool.
684- Optimize worker alive status check.
685- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
686- Optimize `LESS_USED` worker choice strategy.
687- Update benchmark versus external threads pools.
688
689### Fixed
690
691- Ensure trimmable characters are checked at pool initialization.
692- Fix message id integer overflow.
693- Fix pool worker removal in worker choice strategy internals.
694- Fix package publication with pnpm.
695
696## [2.4.0-2] - 2023-04-03
697
698### Added
699
700- Add `LESS_BUSY` worker choice strategy.
701
702### Changed
703
704- Optimize worker storage in pool.
705- Optimize worker alive status check.
706- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
707- Optimize `LESS_USED` worker choice strategy.
708
709### Fixed
710
711- Ensure trimmable characters are checked at pool initialization.
712- Fix message id integer overflow.
713- Fix pool worker removal in worker choice strategy internals.
714- Fix package publication with pnpm.
715
716## [2.4.0-1] - 2023-04-03
717
718### Added
719
720- Add `LESS_BUSY` worker choice strategy.
721
722### Changed
723
724- Optimize worker storage in pool.
725- Optimize worker alive status check.
726- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
727- Optimize `LESS_USED` worker choice strategy.
728
729### Fixed
730
731- Ensure trimmable characters are checked at pool initialization.
732- Fix message id integer overflow.
733- Fix pool worker removal in worker choice strategy internals.
734
735## [2.4.0-0] - 2023-04-03
736
737### Added
738
739- Add `LESS_BUSY` worker choice strategy.
740
741### Changed
742
743- Optimize worker storage in pool.
744- Optimize worker alive status check.
745- BREAKING CHANGE: Rename worker choice strategy `LESS_RECENTLY_USED` to `LESS_USED`.
746- Optimize `LESS_USED` worker choice strategy.
747
748### Fixed
749
750- Ensure trimmable characters are checked at pool initialization.
751- Fix message id integer overflow.
752- Fix pool worker removal in worker choice strategy internals.
753
754## [2.3.10] - 2023-03-18
755
756### Fixed
757
758- Fix package.json `exports` syntax for ESM and CommonJS.
759
760### Changed
761
762- Permit SemVer pre-release publication.
763
764## [2.3.10-2] - 2023-03-18
765
766### Fixed
767
768- Fix package.json `exports` syntax for ESM and CommonJS.
769
770## [2.3.10-1] - 2023-03-18
771
772### Changed
773
774- Permit SemVer pre-release publication.
775
776## [2.3.10-0] - 2023-03-18
777
778### Fixed
779
780- Fix package.json `exports` syntax for ESM and CommonJS.
781
782## [2.3.9] - 2023-03-18
783
784### Changed
785
786- Introduce ESM module support along with CommonJS one.
787
788### Fixed
789
790- Fix brown paper bag bug referencing the same object literal.
791
792## [2.3.8] - 2023-03-18
793
794### Changed
795
796- Switch internal benchmarking code to benny.
797- Switch to TypeScript 5.x.x.
798- Switch rollup bundler plugins to core ones.
799- Switch to TSDoc syntax.
800- Enforce conventional commits.
801
802### Fixed
803
804- Fix random integer generator.
805- Fix worker choice strategy pool type identification at initialization.
806
807## [2.3.7] - 2022-10-23
808
809### Changed
810
811- Switch to open collective FOSS project funding platform.
812- Switch to ts-standard linter configuration on TypeScript code.
813
814### Fixed
815
816- Fixed missing async on pool execute method.
817- Fixed typing in TypeScript example.
818- Fixed types in unit tests.
819
820## [2.3.6] - 2022-10-22
821
822### Changed
823
824- Cleanup pool attributes and methods.
825- Refine error types thrown.
826
827### Fixed
828
829- Fix continuous integration build on windows.
830- Fix code coverage reporting by using c8 instead of nyc.
831
832## [2.3.5] - 2022-10-21
833
834### Changed
835
836- Improve benchmarks: add IO intensive task workload, add task size option, integrate code into linter.
837- Optimize tasks usage lookup implementation.
838
839### Fixed
840
841- Fix missed pool event emitter type export.
842- Fix typedoc documentation generation.
843
844## [2.3.4] - 2022-10-17
845
846### Added
847
848- Fully automate release process with release-it.
849
850### Changed
851
852- Optimize fair share task scheduling algorithm implementation.
853- Update benchmark versus external pools results with latest version.
854
855## [2.3.3] - 2022-10-15
856
857### Added
858
859- Add support for [cluster settings](https://nodejs.org/api/cluster.html#cluster_cluster_settings) in cluster pool options.
860
861## [2.3.2] - 2022-10-14
862
863### Changed
864
865- Optimize fair share worker selection strategy implementation.
866
867### Fixed
868
869- Fix WRR worker selection strategy: ensure the condition triggering the round robin can be fulfilled.
870
871## [2.3.1] - 2022-10-13
872
873### Added
874
875- Pool worker choice strategies:
876 - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN` strategy based on weighted round robin scheduling algorithm using tasks execution time for now.
877 - `WorkerChoiceStrategies.FAIR_SHARE` strategy based on fair share scheduling algorithm using tasks execution time for now.
878
879## [2.2.2] - 2022-10-09
880
881### Fixed
882
883- Fixed `README.md` file.
884
885## [2.2.1] - 2022-10-08
886
887### Added
888
889- Dynamic worker choice strategy change at runtime.
890
891## [2.2.0] - 2022-01-05
892
893### Breaking Changes
894
895- Support only Node.js version 16.x.x for cluster pool: upstream cluster API have changed on that version.
896
897## [2.1.0] - 2021-08-29
898
899### Added
900
901- Add an optional pool option `messageHandler` to `PoolOptions<Worker>` for registering a message handler callback on each worker.
902
903### Breaking Changes
904
905- `AbstractWorker` class `maxInactiveTime`, `killBehavior` and `async` attributes have been removed in favour of the same ones in the worker options `opts` public attribute.
906- `AbstractWorker` class `lastTask` attribute have been renamed to `lastTaskTimestamp`.
907- `AbstractWorker` class `interval` attribute have been renamed to `aliveInterval`.
908- `AbstractWorker` class cannot be instantiated without specifying the `mainWorker` argument referencing the main worker.
909
910## [2.0.2] - 2021-05-12
911
912### Bug fixes
913
914- Fix `busy` event emission on fixed pool type
915
916## [2.0.1] - 2021-03-16
917
918### Bug fixes
919
920- Check if pool options are properly set.
921- `busy` event is emitted on all pool types.
922
923## [2.0.0] - 2021-03-01
924
925### Bug fixes
926
927- Now a thread/process by default is not deleted when the task submitted take more time than maxInactiveTime configured (issue #70).
928
929### Breaking Changes
930
931- `FullPool` event is now renamed to `busy`.
932- `maxInactiveTime` on `ThreadWorker` default behavior is now changed, if you want to keep the old behavior set `killBehavior` to `KillBehaviors.HARD`.
933 _Find more details on our JSDoc._
934
935- `maxTasks` option on `FixedThreadPool` and `DynamicThreadPool` is now removed since is no more needed.
936
937- We changed some internal structures, but you shouldn't be too affected by them as these are internal changes.
938
939### Pool options types declaration merge
940
941`FixedThreadPoolOptions` and `DynamicThreadPoolOptions` type declarations have been merged to `PoolOptions<Worker>`.
942
943#### New `export` strategy
944
945```js
946// Before
947const DynamicThreadPool = require('poolifier/lib/dynamic')
948// After
949const { DynamicThreadPool } = require('poolifier/lib/dynamic')
950```
951
952But you should always prefer just using
953
954```js
955const { DynamicThreadPool } = require('poolifier')
956```
957
958#### New type definitions for input data and response
959
960For cluster worker and worker-thread pools, you can now only send and receive structured-cloneable data.
961_This is not a limitation by poolifier but Node.js._
962
963#### Public property replacements
964
965`numWorkers` property is now `numberOfWorkers`
966
967#### Internal (protected) properties and methods renaming
968
969These properties are not intended for end users
970
971- `id` => `nextMessageId`
972
973These methods are not intended for end users
974
975- `_chooseWorker` => `chooseWorker`
976- `_newWorker` => `createWorker`
977- `_execute` => `internalExecute`
978- `_chooseWorker` => `chooseWorker`
979- `_checkAlive` => `checkAlive`
980- `_run` => `run`
981- `_runAsync` => `runAsync`
982
983## [1.1.0] - 2020-05-21
984
985### Added
986
987- ThreadWorker support async functions as option
988- Various external library patches
989
990## [1.0.0] - 2020-01-24
991
992### Added
993
994- FixedThreadPool implementation
995- DynamicThreadPool implementation
996- WorkerThread implementation to improve developer experience