@@ -7,7 +7,7 @@ title: AsyncQueuer
77
88# Class: AsyncQueuer\< TValue\>
99
10- Defined in: [ async-queuer.ts:266 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L266 )
10+ Defined in: [ async-queuer.ts:271 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L271 )
1111
1212A flexible asynchronous queue for processing tasks with configurable concurrency, priority, and expiration.
1313
@@ -71,7 +71,7 @@ asyncQueuer.start();
7171new AsyncQueuer <TValue >(fn , initialOptions ): AsyncQueuer < TValue >
7272```
7373
74- Defined in: [ async-queuer.ts:274 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L274 )
74+ Defined in: [ async-queuer.ts:279 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L279 )
7575
7676#### Parameters
7777
@@ -95,7 +95,7 @@ Defined in: [async-queuer.ts:274](https://github.com/TanStack/pacer/blob/main/pa
9595fn : (item ) => Promise < any > ;
9696```
9797
98- Defined in: [ async-queuer.ts:275 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L275 )
98+ Defined in: [ async-queuer.ts:280 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L280 )
9999
100100#### Parameters
101101
@@ -115,7 +115,7 @@ Defined in: [async-queuer.ts:275](https://github.com/TanStack/pacer/blob/main/pa
115115key : string ;
116116```
117117
118- Defined in: [ async-queuer.ts:270 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L270 )
118+ Defined in: [ async-queuer.ts:275 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L275 )
119119
120120***
121121
@@ -125,7 +125,7 @@ Defined in: [async-queuer.ts:270](https://github.com/TanStack/pacer/blob/main/pa
125125options : AsyncQueuerOptions < TValue > ;
126126```
127127
128- Defined in: [ async-queuer.ts:271 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L271 )
128+ Defined in: [ async-queuer.ts:276 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L276 )
129129
130130***
131131
@@ -135,7 +135,7 @@ Defined in: [async-queuer.ts:271](https://github.com/TanStack/pacer/blob/main/pa
135135readonly store : Store < Readonly < AsyncQueuerState < TValue >>> ;
136136```
137137
138- Defined in: [ async-queuer.ts:267 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L267 )
138+ Defined in: [ async-queuer.ts:272 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L272 )
139139
140140## Methods
141141
@@ -145,7 +145,7 @@ Defined in: [async-queuer.ts:267](https://github.com/TanStack/pacer/blob/main/pa
145145_emit (): void
146146```
147147
148- Defined in: [ async-queuer.ts:312 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L312 )
148+ Defined in: [ async-queuer.ts:317 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L317 )
149149
150150Emits a change event for the async queuer instance. Mostly useful for devtools.
151151
@@ -164,7 +164,7 @@ addItem(
164164 runOnItemsChange ): boolean
165165```
166166
167- Defined in: [ async-queuer.ts:420 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L420 )
167+ Defined in: [ async-queuer.ts:425 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L425 )
168168
169169Adds an item to the queue. If the queue is full, the item is rejected and onReject is called.
170170Items can be inserted based on priority or at the front/back depending on configuration.
@@ -202,7 +202,7 @@ queuer.addItem('task2', 'front');
202202clear (): void
203203```
204204
205- Defined in: [ async-queuer.ts:724 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L724 )
205+ Defined in: [ async-queuer.ts:733 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L733 )
206206
207207Removes all pending items from the queue. Does not affect active tasks.
208208
@@ -218,7 +218,7 @@ Removes all pending items from the queue. Does not affect active tasks.
218218execute (position ? ): Promise < any >
219219` ` `
220220
221- Defined in: [async-queuer.ts:546 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L546 )
221+ Defined in: [async-queuer.ts:555 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L555 )
222222
223223Removes and returns the next item from the queue and executes the task function with it.
224224
@@ -248,7 +248,7 @@ queuer.execute('back');
248248flush (numberOfItems , position ? ): Promise < void >
249249` ` `
250250
251- Defined in: [async-queuer.ts:581 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L581 )
251+ Defined in: [async-queuer.ts:590 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L590 )
252252
253253Processes a specified number of items to execute immediately with no wait time
254254If no numberOfItems is provided, all items will be processed
@@ -275,7 +275,7 @@ If no numberOfItems is provided, all items will be processed
275275flushAsBatch (batchFunction ): Promise < void >
276276` ` `
277277
278- Defined in: [async-queuer.ts:595 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L595 )
278+ Defined in: [async-queuer.ts:604 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L604 )
279279
280280Processes all items in the queue as a batch using the provided function as an argument
281281The queue is cleared after processing
@@ -298,7 +298,7 @@ The queue is cleared after processing
298298getNextItem (position ): undefined | TValue
299299` ` `
300300
301- Defined in: [async-queuer.ts:499 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L499 )
301+ Defined in: [async-queuer.ts:508 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L508 )
302302
303303Removes and returns the next item from the queue without executing the task function.
304304Use for manual queue management. Normally, use execute() to process items.
@@ -330,7 +330,7 @@ queuer.getNextItem('back');
330330peekActiveItems (): TValue []
331331` ` `
332332
333- Defined in: [async-queuer.ts:687 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L687 )
333+ Defined in: [async-queuer.ts:696 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L696 )
334334
335335Returns the items currently being processed (active tasks).
336336
@@ -346,7 +346,7 @@ Returns the items currently being processed (active tasks).
346346peekAllItems (): TValue []
347347` ` `
348348
349- Defined in: [async-queuer.ts:680 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L680 )
349+ Defined in: [async-queuer.ts:689 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L689 )
350350
351351Returns a copy of all items in the queue, including active and pending items.
352352
@@ -362,7 +362,7 @@ Returns a copy of all items in the queue, including active and pending items.
362362peekNextItem (position ): undefined | TValue
363363` ` `
364364
365- Defined in: [async-queuer.ts:670 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L670 )
365+ Defined in: [async-queuer.ts:679 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L679 )
366366
367367Returns the next item in the queue without removing it.
368368
@@ -391,7 +391,7 @@ queuer.peekNextItem('back'); // back
391391peekPendingItems (): TValue []
392392` ` `
393393
394- Defined in: [async-queuer.ts:694 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L694 )
394+ Defined in: [async-queuer.ts:703 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L703 )
395395
396396Returns the items waiting to be processed (pending tasks).
397397
@@ -407,7 +407,7 @@ Returns the items waiting to be processed (pending tasks).
407407reset (): void
408408` ` `
409409
410- Defined in: [async-queuer.ts:732 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L732 )
410+ Defined in: [async-queuer.ts:741 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L741 )
411411
412412Resets the queuer state to its default values
413413
@@ -423,7 +423,7 @@ Resets the queuer state to its default values
423423setOptions (newOptions ): void
424424` ` `
425425
426- Defined in: [async-queuer.ts:317 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L317 )
426+ Defined in: [async-queuer.ts:322 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L322 )
427427
428428Updates the queuer options. New options are merged with existing options.
429429
@@ -445,7 +445,7 @@ Updates the queuer options. New options are merged with existing options.
445445start (): void
446446` ` `
447447
448- Defined in: [async-queuer.ts:701 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L701 )
448+ Defined in: [async-queuer.ts:710 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L710 )
449449
450450Starts processing items in the queue. If already running, does nothing.
451451
@@ -461,7 +461,7 @@ Starts processing items in the queue. If already running, does nothing.
461461stop (): void
462462` ` `
463463
464- Defined in: [async-queuer.ts:711 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L711 )
464+ Defined in: [async-queuer.ts:720 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L720 )
465465
466466Stops processing items in the queue. Does not clear the queue.
467467
0 commit comments