# QueuerOptions

# Interface: QueuerOptions\<TValue\>

Defined in: [queuer.ts:83](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L83)

Options for configuring a Queuer instance.

These options control queue behavior, item expiration, callbacks, and more.

## Type Parameters

### TValue

`TValue`

## Properties

### addItemsTo?

```ts
optional addItemsTo: QueuePosition;
```

Defined in: [queuer.ts:88](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L88)

Default position to add items to the queuer

#### Default

```ts
'back'
```

***

### expirationDuration?

```ts
optional expirationDuration: number;
```

Defined in: [queuer.ts:93](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L93)

Maximum time in milliseconds that an item can stay in the queue
If not provided, items will never expire

***

### getIsExpired()?

```ts
optional getIsExpired: (item, addedAt) => boolean;
```

Defined in: [queuer.ts:98](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L98)

Function to determine if an item has expired
If provided, this overrides the expirationDuration behavior

#### Parameters

##### item

`TValue`

##### addedAt

`number`

#### Returns

`boolean`

***

### getItemsFrom?

```ts
optional getItemsFrom: QueuePosition;
```

Defined in: [queuer.ts:103](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L103)

Default position to get items from during processing

#### Default

```ts
'front'
```

***

### getPriority()?

```ts
optional getPriority: (item) => number;
```

Defined in: [queuer.ts:108](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L108)

Function to determine priority of items in the queuer
Higher priority items will be processed first

#### Parameters

##### item

`TValue`

#### Returns

`number`

***

### initialItems?

```ts
optional initialItems: TValue[];
```

Defined in: [queuer.ts:112](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L112)

Initial items to populate the queuer with

***

### initialState?

```ts
optional initialState: Partial<QueuerState<TValue>>;
```

Defined in: [queuer.ts:116](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L116)

Initial state for the queuer

***

### key?

```ts
optional key: string;
```

Defined in: [queuer.ts:121](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L121)

Optional key to identify this queuer instance.
If provided, the queuer will be identified by this key in the devtools and PacerProvider if applicable.

***

### maxSize?

```ts
optional maxSize: number;
```

Defined in: [queuer.ts:125](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L125)

Maximum number of items allowed in the queuer

***

### onExecute()?

```ts
optional onExecute: (item, queuer) => void;
```

Defined in: [queuer.ts:129](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L129)

Callback fired whenever an item is removed from the queuer

#### Parameters

##### item

`TValue`

##### queuer

[`Queuer`](../classes/Queuer.md)\<`TValue`\>

#### Returns

`void`

***

### onExpire()?

```ts
optional onExpire: (item, queuer) => void;
```

Defined in: [queuer.ts:133](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L133)

Callback fired whenever an item expires in the queuer

#### Parameters

##### item

`TValue`

##### queuer

[`Queuer`](../classes/Queuer.md)\<`TValue`\>

#### Returns

`void`

***

### onItemsChange()?

```ts
optional onItemsChange: (queuer) => void;
```

Defined in: [queuer.ts:137](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L137)

Callback fired whenever an item is added or removed from the queuer

#### Parameters

##### queuer

[`Queuer`](../classes/Queuer.md)\<`TValue`\>

#### Returns

`void`

***

### onReject()?

```ts
optional onReject: (item, queuer) => void;
```

Defined in: [queuer.ts:141](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L141)

Callback fired whenever an item is rejected from being added to the queuer

#### Parameters

##### item

`TValue`

##### queuer

[`Queuer`](../classes/Queuer.md)\<`TValue`\>

#### Returns

`void`

***

### started?

```ts
optional started: boolean;
```

Defined in: [queuer.ts:145](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L145)

Whether the queuer should start processing tasks immediately

***

### wait?

```ts
optional wait: number | (queuer) => number;
```

Defined in: [queuer.ts:151](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/queuer.ts#L151)

Time in milliseconds to wait between processing items.
Can be a number or a function that returns a number.

#### Default

```ts
0
```
