@ls-stack/utils 3.38.0 → 3.39.0

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.
@@ -6,522 +6,6 @@
6
6
 
7
7
  # \<internal\>
8
8
 
9
- ## Classes
10
-
11
- ### AsyncQueue\<T, E, I\>
12
-
13
- Defined in: [packages/utils/src/asyncQueue.ts:39](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L39)
14
-
15
- #### Extended by
16
-
17
- - [`AsyncQueueWithMeta`](#asyncqueuewithmeta)
18
-
19
- #### Type Parameters
20
-
21
- ##### T
22
-
23
- `T`
24
-
25
- ##### E
26
-
27
- `E` *extends* `ResultValidErrors` = `Error`
28
-
29
- ##### I
30
-
31
- `I` = `unknown`
32
-
33
- #### Constructors
34
-
35
- ##### Constructor
36
-
37
- ```ts
38
- new AsyncQueue<T, E, I>(__namedParameters): AsyncQueue<T, E, I>;
39
- ```
40
-
41
- Defined in: [packages/utils/src/asyncQueue.ts:57](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L57)
42
-
43
- ###### Parameters
44
-
45
- ###### \_\_namedParameters
46
-
47
- [`AsyncQueueOptions`](#asyncqueueoptions) = `{}`
48
-
49
- ###### Returns
50
-
51
- [`AsyncQueue`](#asyncqueue)\<`T`, `E`, `I`\>
52
-
53
- #### Properties
54
-
55
- ##### completions
56
-
57
- ```ts
58
- completions: object[] = [];
59
- ```
60
-
61
- Defined in: [packages/utils/src/asyncQueue.ts:55](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L55)
62
-
63
- ###### meta
64
-
65
- ```ts
66
- meta: I;
67
- ```
68
-
69
- ###### value
70
-
71
- ```ts
72
- value: T;
73
- ```
74
-
75
- ##### events
76
-
77
- ```ts
78
- events: Emitter<{
79
- complete: {
80
- meta: I;
81
- value: T;
82
- };
83
- error: {
84
- error: Error | E;
85
- meta: I;
86
- };
87
- start: {
88
- meta: I;
89
- };
90
- }>;
91
- ```
92
-
93
- Defined in: [packages/utils/src/asyncQueue.ts:47](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L47)
94
-
95
- ##### failures
96
-
97
- ```ts
98
- failures: object[] = [];
99
- ```
100
-
101
- Defined in: [packages/utils/src/asyncQueue.ts:54](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L54)
102
-
103
- ###### error
104
-
105
- ```ts
106
- error: Error | E;
107
- ```
108
-
109
- ###### meta
110
-
111
- ```ts
112
- meta: I;
113
- ```
114
-
115
- #### Accessors
116
-
117
- ##### completed
118
-
119
- ###### Get Signature
120
-
121
- ```ts
122
- get completed(): number;
123
- ```
124
-
125
- Defined in: [packages/utils/src/asyncQueue.ts:282](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L282)
126
-
127
- ###### Returns
128
-
129
- `number`
130
-
131
- ##### failed
132
-
133
- ###### Get Signature
134
-
135
- ```ts
136
- get failed(): number;
137
- ```
138
-
139
- Defined in: [packages/utils/src/asyncQueue.ts:286](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L286)
140
-
141
- ###### Returns
142
-
143
- `number`
144
-
145
- ##### pending
146
-
147
- ###### Get Signature
148
-
149
- ```ts
150
- get pending(): number;
151
- ```
152
-
153
- Defined in: [packages/utils/src/asyncQueue.ts:290](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L290)
154
-
155
- ###### Returns
156
-
157
- `number`
158
-
159
- ##### size
160
-
161
- ###### Get Signature
162
-
163
- ```ts
164
- get size(): number;
165
- ```
166
-
167
- Defined in: [packages/utils/src/asyncQueue.ts:294](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L294)
168
-
169
- ###### Returns
170
-
171
- `number`
172
-
173
- #### Methods
174
-
175
- ##### add()
176
-
177
- ```ts
178
- add(fn, options?): Promise<Result<T, Error | E>>;
179
- ```
180
-
181
- Defined in: [packages/utils/src/asyncQueue.ts:80](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L80)
182
-
183
- ###### Parameters
184
-
185
- ###### fn
186
-
187
- (`ctx`) => `Result`\<`T`, `E`\> \| `Promise`\<`Result`\<`T`, `E`\>\>
188
-
189
- ###### options?
190
-
191
- [`AddOptions`](#addoptions)\<`I`, `T`, `E`\>
192
-
193
- ###### Returns
194
-
195
- `Promise`\<`Result`\<`T`, `Error` \| `E`\>\>
196
-
197
- ##### clear()
198
-
199
- ```ts
200
- clear(): void;
201
- ```
202
-
203
- Defined in: [packages/utils/src/asyncQueue.ts:272](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L272)
204
-
205
- ###### Returns
206
-
207
- `void`
208
-
209
- ##### onIdle()
210
-
211
- ```ts
212
- onIdle(): Promise<void>;
213
- ```
214
-
215
- Defined in: [packages/utils/src/asyncQueue.ts:263](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L263)
216
-
217
- ###### Returns
218
-
219
- `Promise`\<`void`\>
220
-
221
- ##### resultifyAdd()
222
-
223
- ```ts
224
- resultifyAdd(fn, options?): Promise<Result<T, Error | E>>;
225
- ```
226
-
227
- Defined in: [packages/utils/src/asyncQueue.ts:121](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L121)
228
-
229
- ###### Parameters
230
-
231
- ###### fn
232
-
233
- (`ctx`) => `T` \| `Promise`\<`T`\>
234
-
235
- ###### options?
236
-
237
- [`AddOptions`](#addoptions)\<`I`, `T`, `E`\>
238
-
239
- ###### Returns
240
-
241
- `Promise`\<`Result`\<`T`, `Error` \| `E`\>\>
242
-
243
- ***
244
-
245
- ### AsyncQueueWithMeta\<T, I, E\>
246
-
247
- Defined in: [packages/utils/src/asyncQueue.ts:304](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L304)
248
-
249
- #### Extends
250
-
251
- - [`AsyncQueue`](#asyncqueue)\<`T`, `E`, `I`\>
252
-
253
- #### Type Parameters
254
-
255
- ##### T
256
-
257
- `T`
258
-
259
- ##### I
260
-
261
- `I`
262
-
263
- ##### E
264
-
265
- `E` *extends* `ResultValidErrors` = `Error`
266
-
267
- #### Constructors
268
-
269
- ##### Constructor
270
-
271
- ```ts
272
- new AsyncQueueWithMeta<T, I, E>(options?): AsyncQueueWithMeta<T, I, E>;
273
- ```
274
-
275
- Defined in: [packages/utils/src/asyncQueue.ts:309](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L309)
276
-
277
- ###### Parameters
278
-
279
- ###### options?
280
-
281
- [`AsyncQueueOptions`](#asyncqueueoptions)
282
-
283
- ###### Returns
284
-
285
- [`AsyncQueueWithMeta`](#asyncqueuewithmeta)\<`T`, `I`, `E`\>
286
-
287
- ###### Overrides
288
-
289
- [`AsyncQueue`](#asyncqueue).[`constructor`](#constructor)
290
-
291
- #### Properties
292
-
293
- ##### completions
294
-
295
- ```ts
296
- completions: object[] = [];
297
- ```
298
-
299
- Defined in: [packages/utils/src/asyncQueue.ts:55](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L55)
300
-
301
- ###### meta
302
-
303
- ```ts
304
- meta: I;
305
- ```
306
-
307
- ###### value
308
-
309
- ```ts
310
- value: T;
311
- ```
312
-
313
- ###### Inherited from
314
-
315
- [`AsyncQueue`](#asyncqueue).[`completions`](#completions)
316
-
317
- ##### events
318
-
319
- ```ts
320
- events: Emitter<{
321
- complete: {
322
- meta: I;
323
- value: T;
324
- };
325
- error: {
326
- error: Error | E;
327
- meta: I;
328
- };
329
- start: {
330
- meta: I;
331
- };
332
- }>;
333
- ```
334
-
335
- Defined in: [packages/utils/src/asyncQueue.ts:47](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L47)
336
-
337
- ###### Inherited from
338
-
339
- [`AsyncQueue`](#asyncqueue).[`events`](#events)
340
-
341
- ##### failures
342
-
343
- ```ts
344
- failures: object[] = [];
345
- ```
346
-
347
- Defined in: [packages/utils/src/asyncQueue.ts:54](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L54)
348
-
349
- ###### error
350
-
351
- ```ts
352
- error: Error | E;
353
- ```
354
-
355
- ###### meta
356
-
357
- ```ts
358
- meta: I;
359
- ```
360
-
361
- ###### Inherited from
362
-
363
- [`AsyncQueue`](#asyncqueue).[`failures`](#failures)
364
-
365
- #### Accessors
366
-
367
- ##### completed
368
-
369
- ###### Get Signature
370
-
371
- ```ts
372
- get completed(): number;
373
- ```
374
-
375
- Defined in: [packages/utils/src/asyncQueue.ts:282](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L282)
376
-
377
- ###### Returns
378
-
379
- `number`
380
-
381
- ###### Inherited from
382
-
383
- [`AsyncQueue`](#asyncqueue).[`completed`](#completed)
384
-
385
- ##### failed
386
-
387
- ###### Get Signature
388
-
389
- ```ts
390
- get failed(): number;
391
- ```
392
-
393
- Defined in: [packages/utils/src/asyncQueue.ts:286](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L286)
394
-
395
- ###### Returns
396
-
397
- `number`
398
-
399
- ###### Inherited from
400
-
401
- [`AsyncQueue`](#asyncqueue).[`failed`](#failed)
402
-
403
- ##### pending
404
-
405
- ###### Get Signature
406
-
407
- ```ts
408
- get pending(): number;
409
- ```
410
-
411
- Defined in: [packages/utils/src/asyncQueue.ts:290](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L290)
412
-
413
- ###### Returns
414
-
415
- `number`
416
-
417
- ###### Inherited from
418
-
419
- [`AsyncQueue`](#asyncqueue).[`pending`](#pending)
420
-
421
- ##### size
422
-
423
- ###### Get Signature
424
-
425
- ```ts
426
- get size(): number;
427
- ```
428
-
429
- Defined in: [packages/utils/src/asyncQueue.ts:294](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L294)
430
-
431
- ###### Returns
432
-
433
- `number`
434
-
435
- ###### Inherited from
436
-
437
- [`AsyncQueue`](#asyncqueue).[`size`](#size)
438
-
439
- #### Methods
440
-
441
- ##### add()
442
-
443
- ```ts
444
- add(fn, options): Promise<Result<T, Error | E>>;
445
- ```
446
-
447
- Defined in: [packages/utils/src/asyncQueue.ts:313](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L313)
448
-
449
- ###### Parameters
450
-
451
- ###### fn
452
-
453
- (`ctx`) => `Result`\<`T`, `E`\> \| `Promise`\<`Result`\<`T`, `E`\>\>
454
-
455
- ###### options
456
-
457
- [`AddOptionsWithId`](#addoptionswithid)\<`I`, `T`, `E`\>
458
-
459
- ###### Returns
460
-
461
- `Promise`\<`Result`\<`T`, `Error` \| `E`\>\>
462
-
463
- ###### Overrides
464
-
465
- [`AsyncQueue`](#asyncqueue).[`add`](#add)
466
-
467
- ##### clear()
468
-
469
- ```ts
470
- clear(): void;
471
- ```
472
-
473
- Defined in: [packages/utils/src/asyncQueue.ts:272](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L272)
474
-
475
- ###### Returns
476
-
477
- `void`
478
-
479
- ###### Inherited from
480
-
481
- [`AsyncQueue`](#asyncqueue).[`clear`](#clear)
482
-
483
- ##### onIdle()
484
-
485
- ```ts
486
- onIdle(): Promise<void>;
487
- ```
488
-
489
- Defined in: [packages/utils/src/asyncQueue.ts:263](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L263)
490
-
491
- ###### Returns
492
-
493
- `Promise`\<`void`\>
494
-
495
- ###### Inherited from
496
-
497
- [`AsyncQueue`](#asyncqueue).[`onIdle`](#onidle)
498
-
499
- ##### resultifyAdd()
500
-
501
- ```ts
502
- resultifyAdd(fn, options): Promise<Result<T, Error | E>>;
503
- ```
504
-
505
- Defined in: [packages/utils/src/asyncQueue.ts:320](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L320)
506
-
507
- ###### Parameters
508
-
509
- ###### fn
510
-
511
- (`ctx`) => `T` \| `Promise`\<`T`\>
512
-
513
- ###### options
514
-
515
- [`AddOptionsWithId`](#addoptionswithid)\<`I`, `T`, `E`\>
516
-
517
- ###### Returns
518
-
519
- `Promise`\<`Result`\<`T`, `Error` \| `E`\>\>
520
-
521
- ###### Overrides
522
-
523
- [`AsyncQueue`](#asyncqueue).[`resultifyAdd`](#resultifyadd)
524
-
525
9
  ## Type Aliases
526
10
 
527
11
  ### AddOptions\<I, T, E\>
@@ -530,7 +14,9 @@ Defined in: [packages/utils/src/asyncQueue.ts:320](https://github.com/lucasols/u
530
14
  type AddOptions<I, T, E> = object;
531
15
  ```
532
16
 
533
- Defined in: [packages/utils/src/asyncQueue.ts:17](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L17)
17
+ Defined in: [packages/utils/src/asyncQueue.ts:96](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L96)
18
+
19
+ Options for adding individual tasks to the queue
534
20
 
535
21
  #### Type Parameters
536
22
 
@@ -554,7 +40,9 @@ Defined in: [packages/utils/src/asyncQueue.ts:17](https://github.com/lucasols/ut
554
40
  optional meta: I;
555
41
  ```
556
42
 
557
- Defined in: [packages/utils/src/asyncQueue.ts:20](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L20)
43
+ Defined in: [packages/utils/src/asyncQueue.ts:102](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L102)
44
+
45
+ Metadata to associate with this task
558
46
 
559
47
  ##### onComplete()?
560
48
 
@@ -562,7 +50,9 @@ Defined in: [packages/utils/src/asyncQueue.ts:20](https://github.com/lucasols/ut
562
50
  optional onComplete: (value) => void;
563
51
  ```
564
52
 
565
- Defined in: [packages/utils/src/asyncQueue.ts:21](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L21)
53
+ Defined in: [packages/utils/src/asyncQueue.ts:104](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L104)
54
+
55
+ Callback invoked when task completes successfully
566
56
 
567
57
  ###### Parameters
568
58
 
@@ -580,7 +70,9 @@ Defined in: [packages/utils/src/asyncQueue.ts:21](https://github.com/lucasols/ut
580
70
  optional onError: (error) => void;
581
71
  ```
582
72
 
583
- Defined in: [packages/utils/src/asyncQueue.ts:22](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L22)
73
+ Defined in: [packages/utils/src/asyncQueue.ts:106](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L106)
74
+
75
+ Callback invoked when task fails
584
76
 
585
77
  ###### Parameters
586
78
 
@@ -598,7 +90,9 @@ Defined in: [packages/utils/src/asyncQueue.ts:22](https://github.com/lucasols/ut
598
90
  optional signal: AbortSignal;
599
91
  ```
600
92
 
601
- Defined in: [packages/utils/src/asyncQueue.ts:18](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L18)
93
+ Defined in: [packages/utils/src/asyncQueue.ts:98](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L98)
94
+
95
+ AbortSignal to cancel this specific task
602
96
 
603
97
  ##### timeout?
604
98
 
@@ -606,7 +100,9 @@ Defined in: [packages/utils/src/asyncQueue.ts:18](https://github.com/lucasols/ut
606
100
  optional timeout: number;
607
101
  ```
608
102
 
609
- Defined in: [packages/utils/src/asyncQueue.ts:19](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L19)
103
+ Defined in: [packages/utils/src/asyncQueue.ts:100](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L100)
104
+
105
+ Timeout for this specific task in milliseconds
610
106
 
611
107
  ***
612
108
 
@@ -616,7 +112,9 @@ Defined in: [packages/utils/src/asyncQueue.ts:19](https://github.com/lucasols/ut
616
112
  type AddOptionsWithId<I, T, E> = Omit<AddOptions<I, T, E>, "meta"> & object;
617
113
  ```
618
114
 
619
- Defined in: [packages/utils/src/asyncQueue.ts:299](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L299)
115
+ Defined in: [packages/utils/src/asyncQueue.ts:918](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L918)
116
+
117
+ AddOptions variant that requires metadata to be provided
620
118
 
621
119
  #### Type declaration
622
120
 
@@ -648,59 +146,51 @@ meta: I;
648
146
  type AsyncQueueOptions = object;
649
147
  ```
650
148
 
651
- Defined in: [packages/utils/src/asyncQueue.ts:11](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L11)
149
+ Defined in: [packages/utils/src/asyncQueue.ts:76](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L76)
150
+
151
+ Configuration options for AsyncQueue initialization
652
152
 
653
153
  #### Properties
654
154
 
655
- ##### concurrency?
155
+ ##### autoStart?
656
156
 
657
157
  ```ts
658
- optional concurrency: number;
158
+ optional autoStart: boolean;
659
159
  ```
660
160
 
661
- Defined in: [packages/utils/src/asyncQueue.ts:12](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L12)
662
-
663
- ##### signal?
161
+ Defined in: [packages/utils/src/asyncQueue.ts:88](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L88)
664
162
 
665
- ```ts
666
- optional signal: AbortSignal;
667
- ```
163
+ Start processing tasks immediately when added (default: true)
668
164
 
669
- Defined in: [packages/utils/src/asyncQueue.ts:13](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L13)
670
-
671
- ##### timeout?
165
+ ##### concurrency?
672
166
 
673
167
  ```ts
674
- optional timeout: number;
168
+ optional concurrency: number;
675
169
  ```
676
170
 
677
- Defined in: [packages/utils/src/asyncQueue.ts:14](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L14)
171
+ Defined in: [packages/utils/src/asyncQueue.ts:78](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L78)
678
172
 
679
- ***
173
+ Maximum number of tasks to run concurrently (default: 1)
680
174
 
681
- ### RunCtx\<I\>
175
+ ##### rateLimit?
682
176
 
683
177
  ```ts
684
- type RunCtx<I> = object;
178
+ optional rateLimit: RateLimit;
685
179
  ```
686
180
 
687
- Defined in: [packages/utils/src/asyncQueue.ts:25](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L25)
688
-
689
- #### Type Parameters
690
-
691
- ##### I
692
-
693
- `I`
181
+ Defined in: [packages/utils/src/asyncQueue.ts:90](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L90)
694
182
 
695
- #### Properties
183
+ Rate limit configuration to limit tasks per time interval
696
184
 
697
- ##### meta?
185
+ ##### rejectPendingOnError?
698
186
 
699
187
  ```ts
700
- optional meta: I;
188
+ optional rejectPendingOnError: boolean;
701
189
  ```
702
190
 
703
- Defined in: [packages/utils/src/asyncQueue.ts:27](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L27)
191
+ Defined in: [packages/utils/src/asyncQueue.ts:86](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L86)
192
+
193
+ Reject all pending tasks when stopping on error (default: false)
704
194
 
705
195
  ##### signal?
706
196
 
@@ -708,108 +198,100 @@ Defined in: [packages/utils/src/asyncQueue.ts:27](https://github.com/lucasols/ut
708
198
  optional signal: AbortSignal;
709
199
  ```
710
200
 
711
- Defined in: [packages/utils/src/asyncQueue.ts:26](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L26)
201
+ Defined in: [packages/utils/src/asyncQueue.ts:80](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L80)
712
202
 
713
- ***
203
+ AbortSignal to cancel the entire queue
714
204
 
715
- ### Task\<T, E, I\>
205
+ ##### stopOnError?
716
206
 
717
207
  ```ts
718
- type Task<T, E, I> = object;
208
+ optional stopOnError: boolean;
719
209
  ```
720
210
 
721
- Defined in: [packages/utils/src/asyncQueue.ts:30](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L30)
722
-
723
- #### Type Parameters
211
+ Defined in: [packages/utils/src/asyncQueue.ts:84](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L84)
724
212
 
725
- ##### T
726
-
727
- `T`
213
+ Stop processing new tasks when any task fails (default: false)
728
214
 
729
- ##### E
215
+ ##### timeout?
730
216
 
731
- `E` *extends* `ResultValidErrors`
217
+ ```ts
218
+ optional timeout: number;
219
+ ```
732
220
 
733
- ##### I
221
+ Defined in: [packages/utils/src/asyncQueue.ts:82](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L82)
734
222
 
735
- `I`
223
+ Default timeout for all tasks in milliseconds
736
224
 
737
- #### Properties
225
+ ***
738
226
 
739
- ##### meta
227
+ ### RateLimit
740
228
 
741
229
  ```ts
742
- meta: I;
230
+ type RateLimit = object;
743
231
  ```
744
232
 
745
- Defined in: [packages/utils/src/asyncQueue.ts:35](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L35)
233
+ Defined in: [packages/utils/src/asyncQueue.ts:66](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L66)
746
234
 
747
- ##### reject()
235
+ Configuration for rate limiting task execution
748
236
 
749
- ```ts
750
- reject: (reason?) => void;
751
- ```
752
-
753
- Defined in: [packages/utils/src/asyncQueue.ts:33](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L33)
754
-
755
- ###### Parameters
237
+ #### Properties
756
238
 
757
- ###### reason?
239
+ ##### interval
758
240
 
759
- `Result`\<`T`, `E`\>
241
+ ```ts
242
+ interval: DurationObj | number;
243
+ ```
760
244
 
761
- ###### Returns
245
+ Defined in: [packages/utils/src/asyncQueue.ts:70](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L70)
762
246
 
763
- `void`
247
+ Time interval in milliseconds or as a duration object
764
248
 
765
- ##### resolve()
249
+ ##### maxTasks
766
250
 
767
251
  ```ts
768
- resolve: (value) => void;
252
+ maxTasks: number;
769
253
  ```
770
254
 
771
- Defined in: [packages/utils/src/asyncQueue.ts:32](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L32)
772
-
773
- ###### Parameters
774
-
775
- ###### value
255
+ Defined in: [packages/utils/src/asyncQueue.ts:68](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L68)
776
256
 
777
- `Result`\<`T`, `E` \| `Error`\>
257
+ Maximum number of tasks to execute within the interval
778
258
 
779
- ###### Returns
780
-
781
- `void`
259
+ ***
782
260
 
783
- ##### run()
261
+ ### RunCtx\<I\>
784
262
 
785
263
  ```ts
786
- run: (ctx) => Promise<Result<T, E>>;
264
+ type RunCtx<I> = object;
787
265
  ```
788
266
 
789
- Defined in: [packages/utils/src/asyncQueue.ts:31](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L31)
267
+ Defined in: [packages/utils/src/asyncQueue.ts:112](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L112)
790
268
 
791
- ###### Parameters
269
+ Runtime context passed to task functions
792
270
 
793
- ###### ctx
271
+ #### Type Parameters
794
272
 
795
- [`RunCtx`](#runctx)\<`I`\>
273
+ ##### I
796
274
 
797
- ###### Returns
275
+ `I`
798
276
 
799
- `Promise`\<`Result`\<`T`, `E`\>\>
277
+ #### Properties
800
278
 
801
- ##### signal
279
+ ##### meta?
802
280
 
803
281
  ```ts
804
- signal: AbortSignal | undefined;
282
+ optional meta: I;
805
283
  ```
806
284
 
807
- Defined in: [packages/utils/src/asyncQueue.ts:34](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L34)
285
+ Defined in: [packages/utils/src/asyncQueue.ts:116](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L116)
286
+
287
+ Metadata associated with this task
808
288
 
809
- ##### timeout
289
+ ##### signal?
810
290
 
811
291
  ```ts
812
- timeout: number | undefined;
292
+ optional signal: AbortSignal;
813
293
  ```
814
294
 
815
- Defined in: [packages/utils/src/asyncQueue.ts:36](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L36)
295
+ Defined in: [packages/utils/src/asyncQueue.ts:114](https://github.com/lucasols/utils/blob/main/packages/utils/src/asyncQueue.ts#L114)
296
+
297
+ Combined AbortSignal from task, queue, and timeout signals