@@ -7,7 +7,7 @@ title: AsyncQueuer
77
88# Class: AsyncQueuer\< TValue\>
99
10- Defined in: [ async-queuer.ts:94 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L94 )
10+ Defined in: [ async-queuer.ts:95 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L95 )
1111
1212A flexible asynchronous queuer that processes tasks with configurable concurrency control.
1313
@@ -50,7 +50,7 @@ queuer.onSuccess((result) => {
5050new AsyncQueuer <TValue >(initialOptions ): AsyncQueuer < TValue >
5151```
5252
53- Defined in: [ async-queuer.ts:105 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L105 )
53+ Defined in: [ async-queuer.ts:106 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L106 )
5454
5555#### Parameters
5656
@@ -70,7 +70,7 @@ Defined in: [async-queuer.ts:105](https://github.com/TanStack/pacer/blob/main/pa
7070protected options : Required < AsyncQueuerOptions < TValue >> ;
7171```
7272
73- Defined in: [ async-queuer.ts:95 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L95 )
73+ Defined in: [ async-queuer.ts:96 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L96 )
7474
7575## Methods
7676
@@ -83,15 +83,15 @@ addItem(
8383runOnUpdate ): Promise < TValue >
8484```
8585
86- Defined in: [ async-queuer.ts:183 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L183 )
86+ Defined in: [ async-queuer.ts:184 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L184 )
8787
8888Adds a task to the queuer
8989
9090#### Parameters
9191
9292##### fn
9393
94- () => ` Promise ` \< ` TValue ` \>
94+ () => ` Promise ` \< ` TValue ` \> & ` object `
9595
9696##### position
9797
@@ -113,7 +113,7 @@ Adds a task to the queuer
113113clear (): void
114114```
115115
116- Defined in: [ async-queuer.ts:294 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L294 )
116+ Defined in: [ async-queuer.ts:305 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L305 )
117117
118118Removes all items from the queuer
119119
@@ -129,7 +129,7 @@ Removes all items from the queuer
129129getActiveItems (): () => Promise < TValue > []
130130```
131131
132- Defined in: [ async-queuer.ts:328 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L328 )
132+ Defined in: [ async-queuer.ts:339 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L339 )
133133
134134Returns the active items
135135
@@ -145,7 +145,7 @@ Returns the active items
145145getAllItems (): () => Promise < TValue > []
146146```
147147
148- Defined in: [ async-queuer.ts:314 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L314 )
148+ Defined in: [ async-queuer.ts:325 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L325 )
149149
150150Returns a copy of all items in the queuer
151151
@@ -161,7 +161,7 @@ Returns a copy of all items in the queuer
161161getExecutionCount (): number
162162```
163163
164- Defined in: [ async-queuer.ts:321 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L321 )
164+ Defined in: [ async-queuer.ts:332 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L332 )
165165
166166Returns the number of items that have been removed from the queuer
167167
@@ -177,7 +177,7 @@ Returns the number of items that have been removed from the queuer
177177getNextItem (position ): undefined | () => Promise < TValue >
178178```
179179
180- Defined in: [ async-queuer.ts:239 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L239 )
180+ Defined in: [ async-queuer.ts:252 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L252 )
181181
182182Removes and returns an item from the queuer
183183
@@ -199,7 +199,7 @@ Removes and returns an item from the queuer
199199getPendingItems (): () => Promise < TValue > []
200200```
201201
202- Defined in: [ async-queuer.ts:335 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L335 )
202+ Defined in: [ async-queuer.ts:346 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L346 )
203203
204204Returns the pending items
205205
@@ -215,7 +215,7 @@ Returns the pending items
215215isEmpty (): boolean
216216```
217217
218- Defined in: [ async-queuer.ts:273 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L273 )
218+ Defined in: [ async-queuer.ts:284 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L284 )
219219
220220Returns true if the queuer is empty
221221
@@ -231,7 +231,7 @@ Returns true if the queuer is empty
231231isFull (): boolean
232232```
233233
234- Defined in: [ async-queuer.ts:280 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L280 )
234+ Defined in: [ async-queuer.ts:291 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L291 )
235235
236236Returns true if the queuer is full
237237
@@ -247,7 +247,7 @@ Returns true if the queuer is full
247247isIdle (): boolean
248248```
249249
250- Defined in: [ async-queuer.ts:411 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L411 )
250+ Defined in: [ async-queuer.ts:422 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L422 )
251251
252252Returns true if the queuer is running but has no items to process
253253
@@ -263,7 +263,7 @@ Returns true if the queuer is running but has no items to process
263263isRunning (): boolean
264264```
265265
266- Defined in: [ async-queuer.ts:404 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L404 )
266+ Defined in: [ async-queuer.ts:415 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L415 )
267267
268268Returns true if the queuer is running
269269
@@ -279,7 +279,7 @@ Returns true if the queuer is running
279279onError (cb ): () => void
280280```
281281
282- Defined in: [ async-queuer.ts:352 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L352 )
282+ Defined in: [ async-queuer.ts:363 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L363 )
283283
284284Adds a callback to be called when a task errors
285285
@@ -305,7 +305,7 @@ Adds a callback to be called when a task errors
305305onSettled (cb ): () => void
306306```
307307
308- Defined in: [ async-queuer.ts:362 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L362 )
308+ Defined in: [ async-queuer.ts:373 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L373 )
309309
310310Adds a callback to be called when a task is settled
311311
@@ -331,7 +331,7 @@ Adds a callback to be called when a task is settled
331331onSuccess (cb ): () => void
332332```
333333
334- Defined in: [ async-queuer.ts:342 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L342 )
334+ Defined in: [ async-queuer.ts:353 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L353 )
335335
336336Adds a callback to be called when a task succeeds
337337
@@ -357,15 +357,15 @@ Adds a callback to be called when a task succeeds
357357peek (position ): undefined | () => Promise < TValue >
358358```
359359
360- Defined in: [ async-queuer.ts:261 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L261 )
360+ Defined in: [ async-queuer.ts:274 ] ( https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L274 )
361361
362362Returns an item without removing it
363363
364364#### Parameters
365365
366366##### position
367367
368- ` "front" ` | ` "back" `
368+ [ ` QueuePosition ` ] ( ../type-aliases/queueposition.md ) = ` 'front' `
369369
370370#### Returns
371371
@@ -379,7 +379,7 @@ Returns an item without removing it
379379reset (withInitialItems ? ): void
380380` ` `
381381
382- Defined in: [async-queuer.ts:302 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L302 )
382+ Defined in: [async-queuer.ts:313 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L313 )
383383
384384Resets the queuer to its initial state
385385
@@ -401,7 +401,7 @@ Resets the queuer to its initial state
401401setOptions (newOptions ): AsyncQueuerOptions < TValue >
402402` ` `
403403
404- Defined in: [async-queuer.ts:120 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L120 )
404+ Defined in: [async-queuer.ts:121 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L121 )
405405
406406Updates the queuer options
407407Returns the new options state
@@ -424,7 +424,7 @@ Returns the new options state
424424size (): number
425425` ` `
426426
427- Defined in: [async-queuer.ts:287 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L287 )
427+ Defined in: [async-queuer.ts:298 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L298 )
428428
429429Returns the current size of the queuer
430430
@@ -440,7 +440,7 @@ Returns the current size of the queuer
440440start (): Promise < void >
441441` ` `
442442
443- Defined in: [async-queuer.ts:372 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L372 )
443+ Defined in: [async-queuer.ts:383 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L383 )
444444
445445Starts the queuer and processes items
446446
@@ -456,7 +456,7 @@ Starts the queuer and processes items
456456stop (): void
457457` ` `
458458
459- Defined in: [async-queuer.ts:395 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L395 )
459+ Defined in: [async-queuer.ts:406 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L406 )
460460
461461Stops the queuer from processing items
462462
@@ -472,7 +472,7 @@ Stops the queuer from processing items
472472protected tick (): void
473473` ` `
474474
475- Defined in: [async-queuer.ts:130 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L130 )
475+ Defined in: [async-queuer.ts:131 ](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-queuer.ts#L131 )
476476
477477Processes items in the queuer
478478
0 commit comments