@handy-common-utils/promise-utils 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -44
- package/dist/promise-utils.d.ts +3 -3
- package/dist/promise-utils.d.ts.map +1 -1
- package/dist/promise-utils.js +44 -14
- package/dist/promise-utils.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -193,7 +193,7 @@ If the `reason` is a PromiseLike that rejects, its rejection value will be used
|
|
|
193
193
|
| Parameter | Type | Description |
|
|
194
194
|
| ------ | ------ | ------ |
|
|
195
195
|
| `ms` | `number` | The number of milliseconds after which the scheduled rejection will occur. |
|
|
196
|
-
| `reason` | `R` \| `PromiseLike`\<`R`\> \| () => `R` \| `PromiseLike`\<`R`\> | The reason for the rejection, or a function that supplies the reason. |
|
|
196
|
+
| `reason` | `R` \| `PromiseLike`\<`R`\> \| (() => `R` \| `PromiseLike`\<`R`\>) | The reason for the rejection, or a function that supplies the reason. |
|
|
197
197
|
|
|
198
198
|
###### Returns
|
|
199
199
|
|
|
@@ -236,7 +236,7 @@ resolve with that Promise's resolution (i.e. it behaves like resolving with a Pr
|
|
|
236
236
|
| Parameter | Type | Description |
|
|
237
237
|
| ------ | ------ | ------ |
|
|
238
238
|
| `ms` | `number` | The number of milliseconds after which the scheduled resolution will occur. |
|
|
239
|
-
| `result?` | `T` \| `PromiseLike`\<`T`\> \| () => `T` \| `PromiseLike`\<`T`\> | The result to be resolved by the Promise, or a function that supplies the result. |
|
|
239
|
+
| `result?` | `T` \| `PromiseLike`\<`T`\> \| (() => `T` \| `PromiseLike`\<`T`\>) | The result to be resolved by the Promise, or a function that supplies the result. |
|
|
240
240
|
|
|
241
241
|
###### Returns
|
|
242
242
|
|
|
@@ -280,7 +280,7 @@ returned value if it resolves).
|
|
|
280
280
|
| Parameter | Type | Description |
|
|
281
281
|
| ------ | ------ | ------ |
|
|
282
282
|
| `ms` | `number` | The number of milliseconds after which the created Promise will reject. |
|
|
283
|
-
| `reason` | `R` \| `PromiseLike`\<`R`\> \| () => `R` \| `PromiseLike`\<`R`\> | The reason for the rejection, or a function that supplies the reason. |
|
|
283
|
+
| `reason` | `R` \| `PromiseLike`\<`R`\> \| (() => `R` \| `PromiseLike`\<`R`\>) | The reason for the rejection, or a function that supplies the reason. |
|
|
284
284
|
|
|
285
285
|
###### Returns
|
|
286
286
|
|
|
@@ -317,7 +317,7 @@ the returned Promise will adopt that Promise's outcome.
|
|
|
317
317
|
| Parameter | Type | Description |
|
|
318
318
|
| ------ | ------ | ------ |
|
|
319
319
|
| `ms` | `number` | The number of milliseconds after which the created Promise will resolve. |
|
|
320
|
-
| `result?` | `T` \| `PromiseLike`\<`T`\> \| () => `T` \| `PromiseLike`\<`T`\> | The result to be resolved by the Promise, or a function that supplies the result. |
|
|
320
|
+
| `result?` | `T` \| `PromiseLike`\<`T`\> \| (() => `T` \| `PromiseLike`\<`T`\>) | The result to be resolved by the Promise, or a function that supplies the result. |
|
|
321
321
|
|
|
322
322
|
###### Returns
|
|
323
323
|
|
|
@@ -341,7 +341,7 @@ Errors from operations are returned alongside results in the returned array.
|
|
|
341
341
|
This function only resolves when all jobs/operations are settled (either resolved or rejected).
|
|
342
342
|
|
|
343
343
|
If `options.abortOnError` is set to true, this function throws (or rejects with) an error immediately when any job/operation fails.
|
|
344
|
-
In this mode,
|
|
344
|
+
In this mode, no further operations will be started after a failure occurs.
|
|
345
345
|
|
|
346
346
|
###### Type Parameters
|
|
347
347
|
|
|
@@ -416,7 +416,7 @@ A Promise that resolves immediately with the state of the input Promise.
|
|
|
416
416
|
|
|
417
417
|
##### repeat()
|
|
418
418
|
|
|
419
|
-
> `static` **repeat**\<`Result`, `Param`, `Collection`\>(`operation`, `nextParameter`, `collect`, `initialCollection`, `initialParameter
|
|
419
|
+
> `static` **repeat**\<`Result`, `Param`, `Collection`\>(`operation`, `nextParameter`, `collect`, `initialCollection`, `initialParameter?`): `Promise`\<`Collection`\>
|
|
420
420
|
|
|
421
421
|
Executes an operation repeatedly and collects all the results.
|
|
422
422
|
This function is very useful for many scenarios, such like client-side pagination.
|
|
@@ -501,7 +501,7 @@ an immediate run, invoke `operation(1)` yourself before calling `runPeriodically
|
|
|
501
501
|
| Parameter | Type | Description |
|
|
502
502
|
| ------ | ------ | ------ |
|
|
503
503
|
| `operation` | (`iteration`) => `T` \| `Promise`\<`T`\> | Function to run each iteration. Receives the iteration index (1-based). |
|
|
504
|
-
| `interval` | `number` \| `number`[] \| (`iteration`) => `number` \| `undefined` | Number | number[] | ((iteration: number) => number|undefined) defining waits. |
|
|
504
|
+
| `interval` | `number` \| `number`[] \| ((`iteration`) => `number` \| `undefined`) | Number | number[] | ((iteration: number) => number|undefined) defining waits. |
|
|
505
505
|
| `options?` | \{ `maxDurationMs?`: `number`; `maxExecutions?`: `number`; `schedule?`: `"delayAfterEnd"` \| `"delayBetweenStarts"`; \} | Optional configuration. |
|
|
506
506
|
| `options.maxDurationMs?` | `number` | Stop after N milliseconds. |
|
|
507
507
|
| `options.maxExecutions?` | `number` | Stop after N executions. |
|
|
@@ -607,9 +607,9 @@ Note: The rejection of the `operation` parameter is not handled by this function
|
|
|
607
607
|
|
|
608
608
|
| Parameter | Type | Description |
|
|
609
609
|
| ------ | ------ | ------ |
|
|
610
|
-
| `operation` | `Promise`\<`T`\> \| () => `Promise`\<`T`\> | The original Promise or a function that returns a Promise to which the timeout will be applied. |
|
|
610
|
+
| `operation` | `Promise`\<`T`\> \| (() => `Promise`\<`T`\>) | The original Promise or a function that returns a Promise to which the timeout will be applied. |
|
|
611
611
|
| `ms` | `number` | The number of milliseconds for the timeout. |
|
|
612
|
-
| `rejectReason` | `R` \| `PromiseLike`\<`R`\> \| () => `R` \| `PromiseLike`\<`R`\> | The reason to reject with if the timeout occurs, or a function that supplies the reason. |
|
|
612
|
+
| `rejectReason` | `R` \| `PromiseLike`\<`R`\> \| (() => `R` \| `PromiseLike`\<`R`\>) | The reason to reject with if the timeout occurs, or a function that supplies the reason. |
|
|
613
613
|
|
|
614
614
|
###### Returns
|
|
615
615
|
|
|
@@ -642,9 +642,9 @@ You may want to handle it outside this function to avoid warnings like "(node:43
|
|
|
642
642
|
|
|
643
643
|
| Parameter | Type | Description |
|
|
644
644
|
| ------ | ------ | ------ |
|
|
645
|
-
| `operation` | `Promise`\<`T`\> \| () => `Promise`\<`T`\> | The original Promise or a function that returns a Promise to which the timeout will be applied. |
|
|
645
|
+
| `operation` | `Promise`\<`T`\> \| (() => `Promise`\<`T`\>) | The original Promise or a function that returns a Promise to which the timeout will be applied. |
|
|
646
646
|
| `ms` | `number` | The number of milliseconds for the timeout. |
|
|
647
|
-
| `result?` | `T` \| `PromiseLike`\<`T`\> \| () => `T` \| `PromiseLike`\<`T`\> | The result to resolve with if the timeout occurs, or a function that supplies the result. |
|
|
647
|
+
| `result?` | `T` \| `PromiseLike`\<`T`\> \| (() => `T` \| `PromiseLike`\<`T`\>) | The result to resolve with if the timeout occurs, or a function that supplies the result. |
|
|
648
648
|
|
|
649
649
|
###### Returns
|
|
650
650
|
|
|
@@ -663,7 +663,7 @@ A new Promise that resolves to the specified result if the timeout occurs.
|
|
|
663
663
|
Executes multiple jobs/operations with a specified level of concurrency.
|
|
664
664
|
|
|
665
665
|
Unlike `inParallel(...)`, this function may throw or reject an error when a job/operation fails.
|
|
666
|
-
When an error is
|
|
666
|
+
When an error is thrown, the function rejects immediately, and no further operations will be started.
|
|
667
667
|
If you want all the operations to always be executed, use [PromiseUtils.inParallel](#api-inparallel) instead.
|
|
668
668
|
|
|
669
669
|
###### Type Parameters
|
|
@@ -704,7 +704,7 @@ const attributes = await PromiseUtils.withConcurrency(5, topicArns, async (topic
|
|
|
704
704
|
|
|
705
705
|
##### withRetry()
|
|
706
706
|
|
|
707
|
-
> `static` **withRetry**\<`Result`, `TError`\>(`operation`, `backoff`, `shouldRetry
|
|
707
|
+
> `static` **withRetry**\<`Result`, `TError`\>(`operation`, `backoff`, `shouldRetry?`): `Promise`\<`Result`\>
|
|
708
708
|
|
|
709
709
|
Repeatedly performs an operation until a specified criteria is met.
|
|
710
710
|
|
|
@@ -720,7 +720,7 @@ Repeatedly performs an operation until a specified criteria is met.
|
|
|
720
720
|
| Parameter | Type | Description |
|
|
721
721
|
| ------ | ------ | ------ |
|
|
722
722
|
| `operation` | (`attempt`, `previousResult`, `previousError`) => `Promise`\<`Result`\> | A function that outputs a Promise result. Typically, the operation does not use its arguments. |
|
|
723
|
-
| `backoff` | `number`[] \| (`attempt`, `previousResult`, `previousError`) => `number` \| `undefined` | An array of retry backoff periods (in milliseconds) or a function for calculating them. If retry is desired, the specified backoff period is waited before the next call to the operation. If the array runs out of elements or the function returns `undefined` or a negative number, no further calls to the operation will be made. The `attempt` argument passed to the backoff function starts from 1, as it is called immediately after the first attempt and before the first retry. |
|
|
723
|
+
| `backoff` | `number`[] \| ((`attempt`, `previousResult`, `previousError`) => `number` \| `undefined`) | An array of retry backoff periods (in milliseconds) or a function for calculating them. If retry is desired, the specified backoff period is waited before the next call to the operation. If the array runs out of elements or the function returns `undefined` or a negative number, no further calls to the operation will be made. The `attempt` argument passed to the backoff function starts from 1, as it is called immediately after the first attempt and before the first retry. |
|
|
724
724
|
| `shouldRetry` | (`previousError`, `previousResult`, `attempt`) => `boolean` | A predicate function for deciding whether another call to the operation should occur. If this argument is not defined, a retry will occur whenever the operation rejects with an error. The `shouldRetry` function is evaluated before the `backoff`. The `attempt` argument passed to the shouldRetry function starts from 1. |
|
|
725
725
|
|
|
726
726
|
###### Returns
|
|
@@ -803,14 +803,14 @@ The state of a Promise can only be one of: Pending, Fulfilled, and Rejected.
|
|
|
803
803
|
|
|
804
804
|
| Name | Type | Default value |
|
|
805
805
|
| ------ | ------ | ------ |
|
|
806
|
-
| <a id="api-fulfilled"></a> `Fulfilled` | `"Fulfilled"` | `'Fulfilled'` |
|
|
807
|
-
| <a id="api-pending"></a> `Pending` | `"Pending"` | `'Pending'` |
|
|
808
|
-
| <a id="api-rejected"></a> `Rejected` | `"Rejected"` | `'Rejected'` |
|
|
806
|
+
| <a id="api-property-fulfilled"></a> `Fulfilled` | `"Fulfilled"` | `'Fulfilled'` |
|
|
807
|
+
| <a id="api-property-pending"></a> `Pending` | `"Pending"` | `'Pending'` |
|
|
808
|
+
| <a id="api-property-rejected"></a> `Rejected` | `"Rejected"` | `'Rejected'` |
|
|
809
809
|
|
|
810
810
|
|
|
811
811
|
<a id="variablescancellabledelayedrejectmd"></a>
|
|
812
812
|
|
|
813
|
-
### Variable: cancellableDelayedReject
|
|
813
|
+
### Variable: cancellableDelayedReject
|
|
814
814
|
|
|
815
815
|
> `const` **cancellableDelayedReject**: \<`T`, `R`\>(`ms`, `reason`) => `object` = `PromiseUtils.cancellableDelayedReject`
|
|
816
816
|
|
|
@@ -846,7 +846,7 @@ If the `reason` is a PromiseLike that rejects, its rejection value will be used
|
|
|
846
846
|
| Parameter | Type | Description |
|
|
847
847
|
| ------ | ------ | ------ |
|
|
848
848
|
| `ms` | `number` | The number of milliseconds after which the scheduled rejection will occur. |
|
|
849
|
-
| `reason` | `R` \| `PromiseLike`\<`R`\> \| () => `R` \| `PromiseLike`\<`R`\> | The reason for the rejection, or a function that supplies the reason. |
|
|
849
|
+
| `reason` | `R` \| `PromiseLike`\<`R`\> \| (() => `R` \| `PromiseLike`\<`R`\>) | The reason for the rejection, or a function that supplies the reason. |
|
|
850
850
|
|
|
851
851
|
#### Returns
|
|
852
852
|
|
|
@@ -861,10 +861,14 @@ An object with `stop()` and `promise`.
|
|
|
861
861
|
|
|
862
862
|
#### Param
|
|
863
863
|
|
|
864
|
+
**ms**
|
|
865
|
+
|
|
864
866
|
The number of milliseconds after which the scheduled rejection will occur.
|
|
865
867
|
|
|
866
868
|
#### Param
|
|
867
869
|
|
|
870
|
+
**reason**
|
|
871
|
+
|
|
868
872
|
The reason for the rejection, or a function that supplies the reason.
|
|
869
873
|
|
|
870
874
|
#### Returns
|
|
@@ -874,7 +878,7 @@ An object with stop() and promise.
|
|
|
874
878
|
|
|
875
879
|
<a id="variablescancellabledelayedresolvemd"></a>
|
|
876
880
|
|
|
877
|
-
### Variable: cancellableDelayedResolve
|
|
881
|
+
### Variable: cancellableDelayedResolve
|
|
878
882
|
|
|
879
883
|
> `const` **cancellableDelayedResolve**: \<`T`\>(`ms`, `result?`) => `object` = `PromiseUtils.cancellableDelayedResolve`
|
|
880
884
|
|
|
@@ -910,7 +914,7 @@ resolve with that Promise's resolution (i.e. it behaves like resolving with a Pr
|
|
|
910
914
|
| Parameter | Type | Description |
|
|
911
915
|
| ------ | ------ | ------ |
|
|
912
916
|
| `ms` | `number` | The number of milliseconds after which the scheduled resolution will occur. |
|
|
913
|
-
| `result?` | `T` \| `PromiseLike`\<`T`\> \| () => `T` \| `PromiseLike`\<`T`\> | The result to be resolved by the Promise, or a function that supplies the result. |
|
|
917
|
+
| `result?` | `T` \| `PromiseLike`\<`T`\> \| (() => `T` \| `PromiseLike`\<`T`\>) | The result to be resolved by the Promise, or a function that supplies the result. |
|
|
914
918
|
|
|
915
919
|
#### Returns
|
|
916
920
|
|
|
@@ -925,10 +929,14 @@ An object with `stop()` and `promise`.
|
|
|
925
929
|
|
|
926
930
|
#### Param
|
|
927
931
|
|
|
932
|
+
**ms**
|
|
933
|
+
|
|
928
934
|
The number of milliseconds after which the scheduled resolution will occur.
|
|
929
935
|
|
|
930
936
|
#### Param
|
|
931
937
|
|
|
938
|
+
**result**
|
|
939
|
+
|
|
932
940
|
The result to be resolved by the Promise, or a function that supplies the result.
|
|
933
941
|
|
|
934
942
|
#### Returns
|
|
@@ -938,7 +946,7 @@ An object with stop() and promise.
|
|
|
938
946
|
|
|
939
947
|
<a id="variablesdelayedrejectmd"></a>
|
|
940
948
|
|
|
941
|
-
### Variable: delayedReject
|
|
949
|
+
### Variable: delayedReject
|
|
942
950
|
|
|
943
951
|
> `const` **delayedReject**: \<`T`, `R`\>(`ms`, `reason`) => `Promise`\<`T`\> = `PromiseUtils.delayedReject`
|
|
944
952
|
|
|
@@ -976,7 +984,7 @@ returned value if it resolves).
|
|
|
976
984
|
| Parameter | Type | Description |
|
|
977
985
|
| ------ | ------ | ------ |
|
|
978
986
|
| `ms` | `number` | The number of milliseconds after which the created Promise will reject. |
|
|
979
|
-
| `reason` | `R` \| `PromiseLike`\<`R`\> \| () => `R` \| `PromiseLike`\<`R`\> | The reason for the rejection, or a function that supplies the reason. |
|
|
987
|
+
| `reason` | `R` \| `PromiseLike`\<`R`\> \| (() => `R` \| `PromiseLike`\<`R`\>) | The reason for the rejection, or a function that supplies the reason. |
|
|
980
988
|
|
|
981
989
|
#### Returns
|
|
982
990
|
|
|
@@ -986,10 +994,14 @@ A Promise that rejects with the specified reason after the specified delay.
|
|
|
986
994
|
|
|
987
995
|
#### Param
|
|
988
996
|
|
|
997
|
+
**ms**
|
|
998
|
+
|
|
989
999
|
The number of milliseconds after which the created Promise will reject.
|
|
990
1000
|
|
|
991
1001
|
#### Param
|
|
992
1002
|
|
|
1003
|
+
**reason**
|
|
1004
|
+
|
|
993
1005
|
The reason for the rejection, or a function that supplies the reason.
|
|
994
1006
|
|
|
995
1007
|
#### Returns
|
|
@@ -999,7 +1011,7 @@ A Promise that rejects with the specified reason after the specified delay.
|
|
|
999
1011
|
|
|
1000
1012
|
<a id="variablesdelayedresolvemd"></a>
|
|
1001
1013
|
|
|
1002
|
-
### Variable: delayedResolve
|
|
1014
|
+
### Variable: delayedResolve
|
|
1003
1015
|
|
|
1004
1016
|
> `const` **delayedResolve**: \<`T`\>(`ms`, `result?`) => `Promise`\<`T`\> = `PromiseUtils.delayedResolve`
|
|
1005
1017
|
|
|
@@ -1034,7 +1046,7 @@ the returned Promise will adopt that Promise's outcome.
|
|
|
1034
1046
|
| Parameter | Type | Description |
|
|
1035
1047
|
| ------ | ------ | ------ |
|
|
1036
1048
|
| `ms` | `number` | The number of milliseconds after which the created Promise will resolve. |
|
|
1037
|
-
| `result?` | `T` \| `PromiseLike`\<`T`\> \| () => `T` \| `PromiseLike`\<`T`\> | The result to be resolved by the Promise, or a function that supplies the result. |
|
|
1049
|
+
| `result?` | `T` \| `PromiseLike`\<`T`\> \| (() => `T` \| `PromiseLike`\<`T`\>) | The result to be resolved by the Promise, or a function that supplies the result. |
|
|
1038
1050
|
|
|
1039
1051
|
#### Returns
|
|
1040
1052
|
|
|
@@ -1044,10 +1056,14 @@ A Promise that resolves with the specified result after the specified delay.
|
|
|
1044
1056
|
|
|
1045
1057
|
#### Param
|
|
1046
1058
|
|
|
1059
|
+
**ms**
|
|
1060
|
+
|
|
1047
1061
|
The number of milliseconds after which the created Promise will resolve.
|
|
1048
1062
|
|
|
1049
1063
|
#### Param
|
|
1050
1064
|
|
|
1065
|
+
**result**
|
|
1066
|
+
|
|
1051
1067
|
The result to be resolved by the Promise, or a function that supplies the result.
|
|
1052
1068
|
|
|
1053
1069
|
#### Returns
|
|
@@ -1057,7 +1073,7 @@ A Promise that resolves with the specified result after the specified delay.
|
|
|
1057
1073
|
|
|
1058
1074
|
<a id="variablesinparallelmd"></a>
|
|
1059
1075
|
|
|
1060
|
-
### Variable: inParallel
|
|
1076
|
+
### Variable: inParallel
|
|
1061
1077
|
|
|
1062
1078
|
> `const` **inParallel**: \<`Data`, `Result`, `TError`\>(`parallelism`, `jobs`, `operation`, `options?`) => `Promise`\<(`Result` \| `TError`)[]\> = `PromiseUtils.inParallel`
|
|
1063
1079
|
|
|
@@ -1069,7 +1085,7 @@ Errors from operations are returned alongside results in the returned array.
|
|
|
1069
1085
|
This function only resolves when all jobs/operations are settled (either resolved or rejected).
|
|
1070
1086
|
|
|
1071
1087
|
If options.abortOnError is set to true, this function throws (or rejects with) an error immediately when any job/operation fails.
|
|
1072
|
-
In this mode,
|
|
1088
|
+
In this mode, no further operations will be started after a failure occurs.
|
|
1073
1089
|
|
|
1074
1090
|
Executes multiple jobs/operations in parallel. By default, all operations are executed regardless of any failures.
|
|
1075
1091
|
In most cases, using [PromiseUtils.withConcurrency](#withconcurrency) might be more convenient.
|
|
@@ -1079,7 +1095,7 @@ Errors from operations are returned alongside results in the returned array.
|
|
|
1079
1095
|
This function only resolves when all jobs/operations are settled (either resolved or rejected).
|
|
1080
1096
|
|
|
1081
1097
|
If `options.abortOnError` is set to true, this function throws (or rejects with) an error immediately when any job/operation fails.
|
|
1082
|
-
In this mode,
|
|
1098
|
+
In this mode, no further operations will be started after a failure occurs.
|
|
1083
1099
|
|
|
1084
1100
|
#### Type Parameters
|
|
1085
1101
|
|
|
@@ -1127,22 +1143,32 @@ try {
|
|
|
1127
1143
|
|
|
1128
1144
|
#### Param
|
|
1129
1145
|
|
|
1146
|
+
**parallelism**
|
|
1147
|
+
|
|
1130
1148
|
The number of jobs/operations to run concurrently.
|
|
1131
1149
|
|
|
1132
1150
|
#### Param
|
|
1133
1151
|
|
|
1152
|
+
**jobs**
|
|
1153
|
+
|
|
1134
1154
|
The job data to be processed. This function can safely handle an infinite or unknown number of elements.
|
|
1135
1155
|
|
|
1136
1156
|
#### Param
|
|
1137
1157
|
|
|
1158
|
+
**operation**
|
|
1159
|
+
|
|
1138
1160
|
The function that processes job data asynchronously.
|
|
1139
1161
|
|
|
1140
1162
|
#### Param
|
|
1141
1163
|
|
|
1164
|
+
**options**
|
|
1165
|
+
|
|
1142
1166
|
Options to control the function's behavior.
|
|
1143
1167
|
|
|
1144
1168
|
#### Param
|
|
1145
1169
|
|
|
1170
|
+
**options.abortOnError**
|
|
1171
|
+
|
|
1146
1172
|
If true, the function aborts and throws an error on the first failed operation.
|
|
1147
1173
|
|
|
1148
1174
|
#### Returns
|
|
@@ -1154,7 +1180,7 @@ A promise that resolves to an array containing the results of the operations.
|
|
|
1154
1180
|
|
|
1155
1181
|
<a id="variablespromisestatemd"></a>
|
|
1156
1182
|
|
|
1157
|
-
### Variable: promiseState
|
|
1183
|
+
### Variable: promiseState
|
|
1158
1184
|
|
|
1159
1185
|
> `const` **promiseState**: (`p`) => `Promise`\<`"Pending"` \| `"Fulfilled"` \| `"Rejected"`\> = `PromiseUtils.promiseState`
|
|
1160
1186
|
|
|
@@ -1178,6 +1204,8 @@ A Promise that resolves immediately with the state of the input Promise.
|
|
|
1178
1204
|
|
|
1179
1205
|
#### Param
|
|
1180
1206
|
|
|
1207
|
+
**p**
|
|
1208
|
+
|
|
1181
1209
|
The Promise whose state is to be determined.
|
|
1182
1210
|
|
|
1183
1211
|
#### Returns
|
|
@@ -1187,7 +1215,7 @@ A Promise that resolves immediately with the state of the input Promise.
|
|
|
1187
1215
|
|
|
1188
1216
|
<a id="variablesrepeatmd"></a>
|
|
1189
1217
|
|
|
1190
|
-
### Variable: repeat
|
|
1218
|
+
### Variable: repeat
|
|
1191
1219
|
|
|
1192
1220
|
> `const` **repeat**: \<`Result`, `Param`, `Collection`\>(`operation`, `nextParameter`, `collect`, `initialCollection`, `initialParameter`) => `Promise`\<`Collection`\> = `PromiseUtils.repeat`
|
|
1193
1221
|
|
|
@@ -1234,22 +1262,32 @@ const domainNameObjects = await PromiseUtils.repeat(
|
|
|
1234
1262
|
|
|
1235
1263
|
#### Param
|
|
1236
1264
|
|
|
1265
|
+
**operation**
|
|
1266
|
+
|
|
1237
1267
|
A function that takes a parameter as input and returns a result. Typically, the parameter has optional fields to control paging.
|
|
1238
1268
|
|
|
1239
1269
|
#### Param
|
|
1240
1270
|
|
|
1271
|
+
**nextParameter**
|
|
1272
|
+
|
|
1241
1273
|
A function for calculating the next parameter from the operation result. Normally, this parameter controls paging. This function should return null when no further invocation of the operation function is desired. If further invocation is desired, the return value of this function can be a Promise or a non-Promise value.
|
|
1242
1274
|
|
|
1243
1275
|
#### Param
|
|
1244
1276
|
|
|
1277
|
+
**collect**
|
|
1278
|
+
|
|
1245
1279
|
A function for merging the operation result into the collection.
|
|
1246
1280
|
|
|
1247
1281
|
#### Param
|
|
1248
1282
|
|
|
1283
|
+
**initialCollection**
|
|
1284
|
+
|
|
1249
1285
|
The initial collection, which will be the first argument passed to the first invocation of the collect function.
|
|
1250
1286
|
|
|
1251
1287
|
#### Param
|
|
1252
1288
|
|
|
1289
|
+
**initialParameter**
|
|
1290
|
+
|
|
1253
1291
|
The parameter for the first operation.
|
|
1254
1292
|
|
|
1255
1293
|
#### Returns
|
|
@@ -1259,7 +1297,7 @@ A promise that resolves to a collection of all the results returned by the opera
|
|
|
1259
1297
|
|
|
1260
1298
|
<a id="variablesrunperiodicallymd"></a>
|
|
1261
1299
|
|
|
1262
|
-
### Variable: runPeriodically
|
|
1300
|
+
### Variable: runPeriodically
|
|
1263
1301
|
|
|
1264
1302
|
> `const` **runPeriodically**: \<`T`\>(`operation`, `interval`, `options?`) => `object` = `PromiseUtils.runPeriodically`
|
|
1265
1303
|
|
|
@@ -1326,7 +1364,7 @@ an immediate run, invoke `operation(1)` yourself before calling `runPeriodically
|
|
|
1326
1364
|
| Parameter | Type | Description |
|
|
1327
1365
|
| ------ | ------ | ------ |
|
|
1328
1366
|
| `operation` | (`iteration`) => `T` \| `Promise`\<`T`\> | Function to run each iteration. Receives the iteration index (1-based). |
|
|
1329
|
-
| `interval` | `number` \| `number`[] \| (`iteration`) => `number` \| `undefined` | Number | number[] | ((iteration: number) => number|undefined) defining waits. |
|
|
1367
|
+
| `interval` | `number` \| `number`[] \| ((`iteration`) => `number` \| `undefined`) | Number | number[] | ((iteration: number) => number|undefined) defining waits. |
|
|
1330
1368
|
| `options?` | \{ `maxDurationMs?`: `number`; `maxExecutions?`: `number`; `schedule?`: `"delayAfterEnd"` \| `"delayBetweenStarts"`; \} | Optional configuration. |
|
|
1331
1369
|
| `options.maxDurationMs?` | `number` | Stop after N milliseconds. |
|
|
1332
1370
|
| `options.maxExecutions?` | `number` | Stop after N executions. |
|
|
@@ -1346,30 +1384,44 @@ An object containing `stop()` to cancel further executions and `done` Promise
|
|
|
1346
1384
|
|
|
1347
1385
|
#### Template
|
|
1348
1386
|
|
|
1387
|
+
**T**
|
|
1388
|
+
|
|
1349
1389
|
The operation return type (ignored by the runner; used for typing).
|
|
1350
1390
|
|
|
1351
1391
|
#### Param
|
|
1352
1392
|
|
|
1393
|
+
**operation**
|
|
1394
|
+
|
|
1353
1395
|
Function to run each iteration. Receives the iteration index (1-based).
|
|
1354
1396
|
|
|
1355
1397
|
#### Param
|
|
1356
1398
|
|
|
1399
|
+
**interval**
|
|
1400
|
+
|
|
1357
1401
|
Number | number[] | ((iteration: number) => number|undefined) defining waits.
|
|
1358
1402
|
|
|
1359
1403
|
#### Param
|
|
1360
1404
|
|
|
1405
|
+
**options**
|
|
1406
|
+
|
|
1361
1407
|
Optional configuration.
|
|
1362
1408
|
|
|
1363
1409
|
#### Param
|
|
1364
1410
|
|
|
1411
|
+
**options.maxExecutions**
|
|
1412
|
+
|
|
1365
1413
|
Stop after N executions.
|
|
1366
1414
|
|
|
1367
1415
|
#### Param
|
|
1368
1416
|
|
|
1417
|
+
**options.maxDurationMs**
|
|
1418
|
+
|
|
1369
1419
|
Stop after N milliseconds.
|
|
1370
1420
|
|
|
1371
1421
|
#### Param
|
|
1372
1422
|
|
|
1423
|
+
**options.schedule**
|
|
1424
|
+
|
|
1373
1425
|
How to measure intervals: `'delayAfterEnd'` or `'delayBetweenStarts'`.
|
|
1374
1426
|
|
|
1375
1427
|
#### Returns
|
|
@@ -1380,7 +1432,7 @@ An object containing `stop()` to cancel further executions and `done` Promise
|
|
|
1380
1432
|
|
|
1381
1433
|
<a id="variablessynchronisedmd"></a>
|
|
1382
1434
|
|
|
1383
|
-
### Variable: synchronised
|
|
1435
|
+
### Variable: synchronised
|
|
1384
1436
|
|
|
1385
1437
|
> `const` **synchronised**: \<`T`\>(`lock`, `operation`) => `Promise`\<`T`\> = `PromiseUtils.synchronised`
|
|
1386
1438
|
|
|
@@ -1409,10 +1461,14 @@ The result of the operation function.
|
|
|
1409
1461
|
|
|
1410
1462
|
#### Param
|
|
1411
1463
|
|
|
1464
|
+
**lock**
|
|
1465
|
+
|
|
1412
1466
|
The object (such as a string, a number, or this in a class) used to identify the lock.
|
|
1413
1467
|
|
|
1414
1468
|
#### Param
|
|
1415
1469
|
|
|
1470
|
+
**operation**
|
|
1471
|
+
|
|
1416
1472
|
The function that performs the computation and returns a Promise.
|
|
1417
1473
|
|
|
1418
1474
|
#### Returns
|
|
@@ -1422,7 +1478,7 @@ The result of the operation function.
|
|
|
1422
1478
|
|
|
1423
1479
|
<a id="variablessynchronizedmd"></a>
|
|
1424
1480
|
|
|
1425
|
-
### Variable: synchronized
|
|
1481
|
+
### Variable: synchronized
|
|
1426
1482
|
|
|
1427
1483
|
> `const` **synchronized**: \<`T`\>(`lock`, `operation`) => `Promise`\<`T`\> = `PromiseUtils.synchronized`
|
|
1428
1484
|
|
|
@@ -1461,10 +1517,14 @@ The result of the operation function.
|
|
|
1461
1517
|
|
|
1462
1518
|
#### Param
|
|
1463
1519
|
|
|
1520
|
+
**lock**
|
|
1521
|
+
|
|
1464
1522
|
The object (such as a string, a number, or this in a class) used to identify the lock.
|
|
1465
1523
|
|
|
1466
1524
|
#### Param
|
|
1467
1525
|
|
|
1526
|
+
**operation**
|
|
1527
|
+
|
|
1468
1528
|
The function that performs the computation and returns a Promise.
|
|
1469
1529
|
|
|
1470
1530
|
#### Returns
|
|
@@ -1474,7 +1534,7 @@ The result of the operation function.
|
|
|
1474
1534
|
|
|
1475
1535
|
<a id="variablestimeoutrejectmd"></a>
|
|
1476
1536
|
|
|
1477
|
-
### Variable: timeoutReject
|
|
1537
|
+
### Variable: timeoutReject
|
|
1478
1538
|
|
|
1479
1539
|
> `const` **timeoutReject**: \<`T`, `R`\>(`operation`, `ms`, `rejectReason`) => `Promise`\<`T`\> = `PromiseUtils.timeoutReject`
|
|
1480
1540
|
|
|
@@ -1501,9 +1561,9 @@ Note: The rejection of the `operation` parameter is not handled by this function
|
|
|
1501
1561
|
|
|
1502
1562
|
| Parameter | Type | Description |
|
|
1503
1563
|
| ------ | ------ | ------ |
|
|
1504
|
-
| `operation` | `Promise`\<`T`\> \| () => `Promise`\<`T`\> | The original Promise or a function that returns a Promise to which the timeout will be applied. |
|
|
1564
|
+
| `operation` | `Promise`\<`T`\> \| (() => `Promise`\<`T`\>) | The original Promise or a function that returns a Promise to which the timeout will be applied. |
|
|
1505
1565
|
| `ms` | `number` | The number of milliseconds for the timeout. |
|
|
1506
|
-
| `rejectReason` | `R` \| `PromiseLike`\<`R`\> \| () => `R` \| `PromiseLike`\<`R`\> | The reason to reject with if the timeout occurs, or a function that supplies the reason. |
|
|
1566
|
+
| `rejectReason` | `R` \| `PromiseLike`\<`R`\> \| (() => `R` \| `PromiseLike`\<`R`\>) | The reason to reject with if the timeout occurs, or a function that supplies the reason. |
|
|
1507
1567
|
|
|
1508
1568
|
#### Returns
|
|
1509
1569
|
|
|
@@ -1513,14 +1573,20 @@ A new Promise that rejects with the specified reason if the timeout occurs.
|
|
|
1513
1573
|
|
|
1514
1574
|
#### Param
|
|
1515
1575
|
|
|
1576
|
+
**operation**
|
|
1577
|
+
|
|
1516
1578
|
The original Promise or a function that returns a Promise to which the timeout will be applied.
|
|
1517
1579
|
|
|
1518
1580
|
#### Param
|
|
1519
1581
|
|
|
1582
|
+
**ms**
|
|
1583
|
+
|
|
1520
1584
|
The number of milliseconds for the timeout.
|
|
1521
1585
|
|
|
1522
1586
|
#### Param
|
|
1523
1587
|
|
|
1588
|
+
**rejectReason**
|
|
1589
|
+
|
|
1524
1590
|
The reason to reject with if the timeout occurs, or a function that supplies the reason.
|
|
1525
1591
|
|
|
1526
1592
|
#### Returns
|
|
@@ -1530,7 +1596,7 @@ A new Promise that rejects with the specified reason if the timeout occurs.
|
|
|
1530
1596
|
|
|
1531
1597
|
<a id="variablestimeoutresolvemd"></a>
|
|
1532
1598
|
|
|
1533
|
-
### Variable: timeoutResolve
|
|
1599
|
+
### Variable: timeoutResolve
|
|
1534
1600
|
|
|
1535
1601
|
> `const` **timeoutResolve**: \<`T`\>(`operation`, `ms`, `result?`) => `Promise`\<`T`\> = `PromiseUtils.timeoutResolve`
|
|
1536
1602
|
|
|
@@ -1558,9 +1624,9 @@ You may want to handle it outside this function to avoid warnings like "(node:43
|
|
|
1558
1624
|
|
|
1559
1625
|
| Parameter | Type | Description |
|
|
1560
1626
|
| ------ | ------ | ------ |
|
|
1561
|
-
| `operation` | `Promise`\<`T`\> \| () => `Promise`\<`T`\> | The original Promise or a function that returns a Promise to which the timeout will be applied. |
|
|
1627
|
+
| `operation` | `Promise`\<`T`\> \| (() => `Promise`\<`T`\>) | The original Promise or a function that returns a Promise to which the timeout will be applied. |
|
|
1562
1628
|
| `ms` | `number` | The number of milliseconds for the timeout. |
|
|
1563
|
-
| `result?` | `T` \| `PromiseLike`\<`T`\> \| () => `T` \| `PromiseLike`\<`T`\> | The result to resolve with if the timeout occurs, or a function that supplies the result. |
|
|
1629
|
+
| `result?` | `T` \| `PromiseLike`\<`T`\> \| (() => `T` \| `PromiseLike`\<`T`\>) | The result to resolve with if the timeout occurs, or a function that supplies the result. |
|
|
1564
1630
|
|
|
1565
1631
|
#### Returns
|
|
1566
1632
|
|
|
@@ -1570,14 +1636,20 @@ A new Promise that resolves to the specified result if the timeout occurs.
|
|
|
1570
1636
|
|
|
1571
1637
|
#### Param
|
|
1572
1638
|
|
|
1639
|
+
**operation**
|
|
1640
|
+
|
|
1573
1641
|
The original Promise or a function that returns a Promise to which the timeout will be applied.
|
|
1574
1642
|
|
|
1575
1643
|
#### Param
|
|
1576
1644
|
|
|
1645
|
+
**ms**
|
|
1646
|
+
|
|
1577
1647
|
The number of milliseconds for the timeout.
|
|
1578
1648
|
|
|
1579
1649
|
#### Param
|
|
1580
1650
|
|
|
1651
|
+
**result**
|
|
1652
|
+
|
|
1581
1653
|
The result to resolve with if the timeout occurs, or a function that supplies the result.
|
|
1582
1654
|
|
|
1583
1655
|
#### Returns
|
|
@@ -1587,7 +1659,7 @@ A new Promise that resolves to the specified result if the timeout occurs.
|
|
|
1587
1659
|
|
|
1588
1660
|
<a id="variableswithconcurrencymd"></a>
|
|
1589
1661
|
|
|
1590
|
-
### Variable: withConcurrency
|
|
1662
|
+
### Variable: withConcurrency
|
|
1591
1663
|
|
|
1592
1664
|
> `const` **withConcurrency**: \<`Data`, `Result`\>(`concurrency`, `jobs`, `operation`) => `Promise`\<`Result`[]\> = `PromiseUtils.withConcurrency`
|
|
1593
1665
|
|
|
@@ -1596,7 +1668,7 @@ Executes multiple jobs/operations with a specified level of concurrency.
|
|
|
1596
1668
|
Executes multiple jobs/operations with a specified level of concurrency.
|
|
1597
1669
|
|
|
1598
1670
|
Unlike `inParallel(...)`, this function may throw or reject an error when a job/operation fails.
|
|
1599
|
-
When an error is
|
|
1671
|
+
When an error is thrown, the function rejects immediately, and no further operations will be started.
|
|
1600
1672
|
If you want all the operations to always be executed, use [PromiseUtils.inParallel](#inparallel) instead.
|
|
1601
1673
|
|
|
1602
1674
|
#### Type Parameters
|
|
@@ -1633,14 +1705,20 @@ const attributes = await PromiseUtils.withConcurrency(5, topicArns, async (topic
|
|
|
1633
1705
|
|
|
1634
1706
|
#### Param
|
|
1635
1707
|
|
|
1708
|
+
**concurrency**
|
|
1709
|
+
|
|
1636
1710
|
The number of jobs/operations to run concurrently.
|
|
1637
1711
|
|
|
1638
1712
|
#### Param
|
|
1639
1713
|
|
|
1714
|
+
**jobs**
|
|
1715
|
+
|
|
1640
1716
|
The job data to be processed. This function can handle an infinite or unknown number of elements safely.
|
|
1641
1717
|
|
|
1642
1718
|
#### Param
|
|
1643
1719
|
|
|
1720
|
+
**operation**
|
|
1721
|
+
|
|
1644
1722
|
The function that processes job data asynchronously.
|
|
1645
1723
|
|
|
1646
1724
|
#### Returns
|
|
@@ -1651,7 +1729,7 @@ A promise that resolves to an array containing the results from the operation fu
|
|
|
1651
1729
|
|
|
1652
1730
|
<a id="variableswithretrymd"></a>
|
|
1653
1731
|
|
|
1654
|
-
### Variable: withRetry
|
|
1732
|
+
### Variable: withRetry
|
|
1655
1733
|
|
|
1656
1734
|
> `const` **withRetry**: \<`Result`, `TError`\>(`operation`, `backoff`, `shouldRetry`) => `Promise`\<`Result`\> = `PromiseUtils.withRetry`
|
|
1657
1735
|
|
|
@@ -1671,7 +1749,7 @@ Repeatedly performs an operation until a specified criteria is met.
|
|
|
1671
1749
|
| Parameter | Type | Description |
|
|
1672
1750
|
| ------ | ------ | ------ |
|
|
1673
1751
|
| `operation` | (`attempt`, `previousResult`, `previousError`) => `Promise`\<`Result`\> | A function that outputs a Promise result. Typically, the operation does not use its arguments. |
|
|
1674
|
-
| `backoff` | `number`[] \| (`attempt`, `previousResult`, `previousError`) => `number` \| `undefined` | An array of retry backoff periods (in milliseconds) or a function for calculating them. If retry is desired, the specified backoff period is waited before the next call to the operation. If the array runs out of elements or the function returns `undefined` or a negative number, no further calls to the operation will be made. The `attempt` argument passed to the backoff function starts from 1, as it is called immediately after the first attempt and before the first retry. |
|
|
1752
|
+
| `backoff` | `number`[] \| ((`attempt`, `previousResult`, `previousError`) => `number` \| `undefined`) | An array of retry backoff periods (in milliseconds) or a function for calculating them. If retry is desired, the specified backoff period is waited before the next call to the operation. If the array runs out of elements or the function returns `undefined` or a negative number, no further calls to the operation will be made. The `attempt` argument passed to the backoff function starts from 1, as it is called immediately after the first attempt and before the first retry. |
|
|
1675
1753
|
| `shouldRetry` | (`previousError`, `previousResult`, `attempt`) => `boolean` | A predicate function for deciding whether another call to the operation should occur. If this argument is not defined, a retry will occur whenever the operation rejects with an error. The `shouldRetry` function is evaluated before the `backoff`. The `attempt` argument passed to the shouldRetry function starts from 1. |
|
|
1676
1754
|
|
|
1677
1755
|
#### Returns
|
|
@@ -1690,14 +1768,20 @@ const result3 = await PromiseUtils.withRetry(() => doSomething(), attempt => att
|
|
|
1690
1768
|
|
|
1691
1769
|
#### Param
|
|
1692
1770
|
|
|
1771
|
+
**operation**
|
|
1772
|
+
|
|
1693
1773
|
A function that outputs a Promise result. Typically, the operation does not use its arguments.
|
|
1694
1774
|
|
|
1695
1775
|
#### Param
|
|
1696
1776
|
|
|
1777
|
+
**backoff**
|
|
1778
|
+
|
|
1697
1779
|
An array of retry backoff periods (in milliseconds) or a function for calculating them.
|
|
1698
1780
|
|
|
1699
1781
|
#### Param
|
|
1700
1782
|
|
|
1783
|
+
**shouldRetry**
|
|
1784
|
+
|
|
1701
1785
|
A predicate function for deciding whether another call to the operation should occur.
|
|
1702
1786
|
|
|
1703
1787
|
#### Returns
|
package/dist/promise-utils.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ export declare abstract class PromiseUtils {
|
|
|
87
87
|
* Executes multiple jobs/operations with a specified level of concurrency.
|
|
88
88
|
*
|
|
89
89
|
* Unlike `inParallel(...)`, this function may throw or reject an error when a job/operation fails.
|
|
90
|
-
* When an error is
|
|
90
|
+
* When an error is thrown, the function rejects immediately, and no further operations will be started.
|
|
91
91
|
* If you want all the operations to always be executed, use {@link PromiseUtils.inParallel} instead.
|
|
92
92
|
*
|
|
93
93
|
* @example
|
|
@@ -117,7 +117,7 @@ export declare abstract class PromiseUtils {
|
|
|
117
117
|
* This function only resolves when all jobs/operations are settled (either resolved or rejected).
|
|
118
118
|
*
|
|
119
119
|
* If `options.abortOnError` is set to true, this function throws (or rejects with) an error immediately when any job/operation fails.
|
|
120
|
-
* In this mode,
|
|
120
|
+
* In this mode, no further operations will be started after a failure occurs.
|
|
121
121
|
*
|
|
122
122
|
* @example
|
|
123
123
|
* // Capture errors in the returned array
|
|
@@ -364,7 +364,7 @@ export declare const withConcurrency: typeof PromiseUtils.withConcurrency;
|
|
|
364
364
|
* This function only resolves when all jobs/operations are settled (either resolved or rejected).
|
|
365
365
|
*
|
|
366
366
|
* If options.abortOnError is set to true, this function throws (or rejects with) an error immediately when any job/operation fails.
|
|
367
|
-
* In this mode,
|
|
367
|
+
* In this mode, no further operations will be started after a failure occurs.
|
|
368
368
|
*
|
|
369
369
|
* @param parallelism The number of jobs/operations to run concurrently.
|
|
370
370
|
* @param jobs The job data to be processed. This function can safely handle an infinite or unknown number of elements.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise-utils.d.ts","sourceRoot":"","sources":["../src/promise-utils.ts"],"names":[],"mappings":"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@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runPeriodically = exports.promiseState = exports.synchronised = exports.synchronized = exports.timeoutReject = exports.timeoutResolve = exports.cancellableDelayedReject = exports.cancellableDelayedResolve = exports.delayedReject = exports.delayedResolve = exports.inParallel = exports.withConcurrency = exports.withRetry = exports.repeat = exports.PromiseUtils = exports.PromiseState = exports.EXPONENTIAL_SEQUENCE = exports.FIBONACCI_SEQUENCE = void 0;
|
|
4
|
+
/* c8 ignore next */
|
|
4
5
|
/**
|
|
5
6
|
* Array of 25 Fibonacci numbers starting from 1 up to 317811.
|
|
6
7
|
* It can be used to form your own backoff interval array.
|
|
@@ -13,6 +14,7 @@ exports.runPeriodically = exports.promiseState = exports.synchronised = exports.
|
|
|
13
14
|
* PromiseUtils.withRetry(() => doSomething(), FIBONACCI_SEQUENCE.slice(0, 5).map(n => 1000 * n * (1 + (Math.random() - 0.5) / 5)), err => err.statusCode === 429);
|
|
14
15
|
*/
|
|
15
16
|
exports.FIBONACCI_SEQUENCE = [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811];
|
|
17
|
+
/* c8 ignore next */
|
|
16
18
|
/**
|
|
17
19
|
* Array of 25 exponential numbers starting from 1 up to 33554432.
|
|
18
20
|
* It can be used to form your own backoff interval array.
|
|
@@ -119,7 +121,7 @@ class PromiseUtils {
|
|
|
119
121
|
* Executes multiple jobs/operations with a specified level of concurrency.
|
|
120
122
|
*
|
|
121
123
|
* Unlike `inParallel(...)`, this function may throw or reject an error when a job/operation fails.
|
|
122
|
-
* When an error is
|
|
124
|
+
* When an error is thrown, the function rejects immediately, and no further operations will be started.
|
|
123
125
|
* If you want all the operations to always be executed, use {@link PromiseUtils.inParallel} instead.
|
|
124
126
|
*
|
|
125
127
|
* @example
|
|
@@ -151,7 +153,7 @@ class PromiseUtils {
|
|
|
151
153
|
* This function only resolves when all jobs/operations are settled (either resolved or rejected).
|
|
152
154
|
*
|
|
153
155
|
* If `options.abortOnError` is set to true, this function throws (or rejects with) an error immediately when any job/operation fails.
|
|
154
|
-
* In this mode,
|
|
156
|
+
* In this mode, no further operations will be started after a failure occurs.
|
|
155
157
|
*
|
|
156
158
|
* @example
|
|
157
159
|
* // Capture errors in the returned array
|
|
@@ -187,10 +189,14 @@ class PromiseUtils {
|
|
|
187
189
|
}
|
|
188
190
|
const jobResults = new Array();
|
|
189
191
|
let index = 0;
|
|
192
|
+
let aborted = false;
|
|
190
193
|
const iterator = jobs[Symbol.iterator]();
|
|
191
|
-
const promises = Array.from({ length: Math.floor(parallelism) }
|
|
194
|
+
const promises = Array.from({ length: Math.floor(parallelism) }, (async (_) => {
|
|
192
195
|
let iteratorResult;
|
|
193
196
|
while (true) {
|
|
197
|
+
if (aborted) {
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
194
200
|
iteratorResult = iterator.next();
|
|
195
201
|
if (iteratorResult.done) {
|
|
196
202
|
break;
|
|
@@ -198,9 +204,15 @@ class PromiseUtils {
|
|
|
198
204
|
const job = iteratorResult.value;
|
|
199
205
|
const jobIndex = index++;
|
|
200
206
|
const jobResultPromise = operation(job, jobIndex);
|
|
201
|
-
|
|
207
|
+
try {
|
|
208
|
+
jobResults[jobIndex] = (options === null || options === void 0 ? void 0 : options.abortOnError) ? await jobResultPromise : await jobResultPromise.catch(error => error);
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
aborted = true;
|
|
212
|
+
throw error;
|
|
213
|
+
}
|
|
202
214
|
}
|
|
203
|
-
});
|
|
215
|
+
}));
|
|
204
216
|
await Promise.all(promises);
|
|
205
217
|
return jobResults;
|
|
206
218
|
}
|
|
@@ -334,12 +346,14 @@ class PromiseUtils {
|
|
|
334
346
|
*/
|
|
335
347
|
static timeoutResolve(operation, ms, result) {
|
|
336
348
|
const promise = typeof operation === 'function' ? operation() : operation;
|
|
349
|
+
const { stop, promise: timeoutPromise } = PromiseUtils.cancellableDelayedResolve(ms, () => PromiseUtils.promiseState(promise)
|
|
350
|
+
.then(state => state === exports.PromiseState.Pending ?
|
|
351
|
+
(typeof result === 'function' ? result() : result) :
|
|
352
|
+
{}));
|
|
353
|
+
promise.then(() => stop(), () => stop());
|
|
337
354
|
return Promise.race([
|
|
338
355
|
promise,
|
|
339
|
-
|
|
340
|
-
.then(state => state === exports.PromiseState.Pending ?
|
|
341
|
-
(typeof result === 'function' ? result() : result) :
|
|
342
|
-
{})),
|
|
356
|
+
timeoutPromise,
|
|
343
357
|
]);
|
|
344
358
|
}
|
|
345
359
|
/**
|
|
@@ -356,12 +370,14 @@ class PromiseUtils {
|
|
|
356
370
|
*/
|
|
357
371
|
static timeoutReject(operation, ms, rejectReason) {
|
|
358
372
|
const promise = typeof operation === 'function' ? operation() : operation;
|
|
373
|
+
const { stop, promise: timeoutPromise } = PromiseUtils.cancellableDelayedReject(ms, () => PromiseUtils.promiseState(promise)
|
|
374
|
+
.then(state => state === exports.PromiseState.Pending ?
|
|
375
|
+
(typeof rejectReason === 'function' ? rejectReason() : rejectReason) :
|
|
376
|
+
{}));
|
|
377
|
+
promise.then(() => stop(), () => stop());
|
|
359
378
|
return Promise.race([
|
|
360
379
|
promise,
|
|
361
|
-
|
|
362
|
-
.then(state => state === exports.PromiseState.Pending ?
|
|
363
|
-
(typeof rejectReason === 'function' ? rejectReason() : rejectReason) :
|
|
364
|
-
{})),
|
|
380
|
+
timeoutPromise,
|
|
365
381
|
]);
|
|
366
382
|
}
|
|
367
383
|
/**
|
|
@@ -523,6 +539,7 @@ class PromiseUtils {
|
|
|
523
539
|
}
|
|
524
540
|
exports.PromiseUtils = PromiseUtils;
|
|
525
541
|
PromiseUtils.synchronizationLocks = new Map();
|
|
542
|
+
/* c8 ignore next */
|
|
526
543
|
/**
|
|
527
544
|
* Executes an operation repeatedly and collects all the results.
|
|
528
545
|
* This function is very useful for many scenarios, such like client-side pagination.
|
|
@@ -535,6 +552,7 @@ PromiseUtils.synchronizationLocks = new Map();
|
|
|
535
552
|
* @returns A promise that resolves to a collection of all the results returned by the operation function.
|
|
536
553
|
*/
|
|
537
554
|
exports.repeat = PromiseUtils.repeat;
|
|
555
|
+
/* c8 ignore next */
|
|
538
556
|
/**
|
|
539
557
|
* Repeatedly performs an operation until a specified criteria is met.
|
|
540
558
|
*
|
|
@@ -544,6 +562,7 @@ exports.repeat = PromiseUtils.repeat;
|
|
|
544
562
|
* @returns A promise of the operation result, potentially with retries applied.
|
|
545
563
|
*/
|
|
546
564
|
exports.withRetry = PromiseUtils.withRetry;
|
|
565
|
+
/* c8 ignore next */
|
|
547
566
|
/**
|
|
548
567
|
* Executes multiple jobs/operations with a specified level of concurrency.
|
|
549
568
|
*
|
|
@@ -554,6 +573,7 @@ exports.withRetry = PromiseUtils.withRetry;
|
|
|
554
573
|
* The results in the returned array are in the same order as the corresponding elements in the jobs array.
|
|
555
574
|
*/
|
|
556
575
|
exports.withConcurrency = PromiseUtils.withConcurrency;
|
|
576
|
+
/* c8 ignore next */
|
|
557
577
|
/**
|
|
558
578
|
* Executes multiple jobs/operations in parallel. By default, all operations are executed regardless of any failures.
|
|
559
579
|
* In most cases, using withConcurrency might be more convenient.
|
|
@@ -563,7 +583,7 @@ exports.withConcurrency = PromiseUtils.withConcurrency;
|
|
|
563
583
|
* This function only resolves when all jobs/operations are settled (either resolved or rejected).
|
|
564
584
|
*
|
|
565
585
|
* If options.abortOnError is set to true, this function throws (or rejects with) an error immediately when any job/operation fails.
|
|
566
|
-
* In this mode,
|
|
586
|
+
* In this mode, no further operations will be started after a failure occurs.
|
|
567
587
|
*
|
|
568
588
|
* @param parallelism The number of jobs/operations to run concurrently.
|
|
569
589
|
* @param jobs The job data to be processed. This function can safely handle an infinite or unknown number of elements.
|
|
@@ -575,6 +595,7 @@ exports.withConcurrency = PromiseUtils.withConcurrency;
|
|
|
575
595
|
* The results or errors in the returned array are in the same order as the corresponding elements in the jobs array.
|
|
576
596
|
*/
|
|
577
597
|
exports.inParallel = PromiseUtils.inParallel;
|
|
598
|
+
/* c8 ignore next */
|
|
578
599
|
/**
|
|
579
600
|
* Creates a Promise that resolves after a specified number of milliseconds.
|
|
580
601
|
*
|
|
@@ -591,6 +612,7 @@ exports.inParallel = PromiseUtils.inParallel;
|
|
|
591
612
|
* @returns A Promise that resolves with the specified result after the specified delay.
|
|
592
613
|
*/
|
|
593
614
|
exports.delayedResolve = PromiseUtils.delayedResolve;
|
|
615
|
+
/* c8 ignore next */
|
|
594
616
|
/**
|
|
595
617
|
* Creates a Promise that rejects after a specified number of milliseconds.
|
|
596
618
|
*
|
|
@@ -608,6 +630,7 @@ exports.delayedResolve = PromiseUtils.delayedResolve;
|
|
|
608
630
|
* @returns A Promise that rejects with the specified reason after the specified delay.
|
|
609
631
|
*/
|
|
610
632
|
exports.delayedReject = PromiseUtils.delayedReject;
|
|
633
|
+
/* c8 ignore next */
|
|
611
634
|
/**
|
|
612
635
|
* Creates a cancellable timer that will resolve after a specified number of milliseconds.
|
|
613
636
|
*
|
|
@@ -624,6 +647,7 @@ exports.delayedReject = PromiseUtils.delayedReject;
|
|
|
624
647
|
* @returns An object with stop() and promise.
|
|
625
648
|
*/
|
|
626
649
|
exports.cancellableDelayedResolve = PromiseUtils.cancellableDelayedResolve;
|
|
650
|
+
/* c8 ignore next */
|
|
627
651
|
/**
|
|
628
652
|
* Creates a cancellable timer that will reject after a specified number of milliseconds.
|
|
629
653
|
*
|
|
@@ -640,6 +664,7 @@ exports.cancellableDelayedResolve = PromiseUtils.cancellableDelayedResolve;
|
|
|
640
664
|
* @returns An object with stop() and promise.
|
|
641
665
|
*/
|
|
642
666
|
exports.cancellableDelayedReject = PromiseUtils.cancellableDelayedReject;
|
|
667
|
+
/* c8 ignore next */
|
|
643
668
|
/**
|
|
644
669
|
* Applies a timeout to a Promise or a function that returns a Promise.
|
|
645
670
|
* If the timeout occurs, the returned Promise resolves to the specified result.
|
|
@@ -654,6 +679,7 @@ exports.cancellableDelayedReject = PromiseUtils.cancellableDelayedReject;
|
|
|
654
679
|
* @returns A new Promise that resolves to the specified result if the timeout occurs.
|
|
655
680
|
*/
|
|
656
681
|
exports.timeoutResolve = PromiseUtils.timeoutResolve;
|
|
682
|
+
/* c8 ignore next */
|
|
657
683
|
/**
|
|
658
684
|
* Applies a timeout to a Promise or a function that returns a Promise.
|
|
659
685
|
* If the timeout occurs, the returned Promise rejects with the specified reason.
|
|
@@ -667,6 +693,7 @@ exports.timeoutResolve = PromiseUtils.timeoutResolve;
|
|
|
667
693
|
* @returns A new Promise that rejects with the specified reason if the timeout occurs.
|
|
668
694
|
*/
|
|
669
695
|
exports.timeoutReject = PromiseUtils.timeoutReject;
|
|
696
|
+
/* c8 ignore next */
|
|
670
697
|
/**
|
|
671
698
|
* Provides mutual exclusion similar to synchronized in Java.
|
|
672
699
|
* Ensures no concurrent execution of any operation function associated with the same lock.
|
|
@@ -680,6 +707,7 @@ exports.timeoutReject = PromiseUtils.timeoutReject;
|
|
|
680
707
|
* @returns The result of the operation function.
|
|
681
708
|
*/
|
|
682
709
|
exports.synchronized = PromiseUtils.synchronized;
|
|
710
|
+
/* c8 ignore next */
|
|
683
711
|
/**
|
|
684
712
|
* This is just another spelling of synchronized.
|
|
685
713
|
* @param lock The object (such as a string, a number, or this in a class) used to identify the lock.
|
|
@@ -687,6 +715,7 @@ exports.synchronized = PromiseUtils.synchronized;
|
|
|
687
715
|
* @returns The result of the operation function.
|
|
688
716
|
*/
|
|
689
717
|
exports.synchronised = PromiseUtils.synchronised;
|
|
718
|
+
/* c8 ignore next */
|
|
690
719
|
/**
|
|
691
720
|
* Retrieves the state of the specified Promise.
|
|
692
721
|
* Note: The returned value is a Promise that resolves immediately.
|
|
@@ -695,6 +724,7 @@ exports.synchronised = PromiseUtils.synchronised;
|
|
|
695
724
|
* @returns A Promise that resolves immediately with the state of the input Promise.
|
|
696
725
|
*/
|
|
697
726
|
exports.promiseState = PromiseUtils.promiseState;
|
|
727
|
+
/* c8 ignore next */
|
|
698
728
|
/**
|
|
699
729
|
* Runs an operation periodically with configurable intervals and stopping conditions.
|
|
700
730
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise-utils.js","sourceRoot":"","sources":["../src/promise-utils.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACU,QAAA,kBAAkB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAElL;;;;;;;;;;GAUG;AACU,QAAA,oBAAoB,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAE/M;;GAEG;AACU,QAAA,YAAY,GAAG;IAC1B,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;CACZ,CAAC;AAIX,MAAsB,YAAY;IAChC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,CAAC,KAAK,CAAC,MAAM,CACjB,SAAyD,EACzD,aA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ACU,QAAA,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC;AAElD,oBAAoB;AACpB;;;;;;;;;;;;;;GAcG;AACU,QAAA,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC;AAE1D,oBAAoB;AACpB;;;;;;;;;;;;;;;GAeG;AACU,QAAA,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC;AAExD,oBAAoB;AACpB;;;;;;;;;;;;;;GAcG;AACU,QAAA,yBAAyB,GAAG,YAAY,CAAC,yBAAyB,CAAC;AAEhF,oBAAoB;AACpB;;;;;;;;;;;;;;GAcG;AACU,QAAA,wBAAwB,GAAG,YAAY,CAAC,wBAAwB,CAAC;AAE9E,oBAAoB;AACpB;;;;;;;;;;;;GAYG;AACU,QAAA,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC;AAE1D,oBAAoB;AACpB;;;;;;;;;;;GAWG;AACU,QAAA,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC;AAExD,oBAAoB;AACpB;;;;;;;;;;;GAWG;AACU,QAAA,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC;AAEtD,oBAAoB;AACpB;;;;;GAKG;AACU,QAAA,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC;AAEtD,oBAAoB;AACpB;;;;;;GAMG;AACU,QAAA,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC;AAEtD,oBAAoB;AACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACU,QAAA,eAAe,GAAG,YAAY,CAAC,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@handy-common-utils/promise-utils",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "Promise related utilities",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"pretest": "eslint . --ext .ts",
|
|
7
|
-
"test": "
|
|
7
|
+
"test": "c8 mocha",
|
|
8
8
|
"prepare": "shx rm -rf dist && tsc && es-check",
|
|
9
9
|
"preversion": "generate-api-docs-and-update-readme && git add README.md"
|
|
10
10
|
},
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"types": "dist/promise-utils.d.ts",
|
|
17
17
|
"bin": {},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@handy-common-utils/dev-dependencies-mocha": "^1.
|
|
20
|
-
"@types/node": "^
|
|
19
|
+
"@handy-common-utils/dev-dependencies-mocha": "^1.11.13",
|
|
20
|
+
"@types/node": "^22.19.21"
|
|
21
21
|
},
|
|
22
22
|
"publishConfig": {
|
|
23
23
|
"access": "public"
|