Skip to content
Source
Sign inSign up
TanStack/pacer
Open History to see the last commit

AsyncRateLimiterState.md

132 lines2.9 KB

1---
2id: AsyncRateLimiterState
3title: AsyncRateLimiterState
4---
5​
6Defined in: [async-rate-limiter.ts:8](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-rate-limiter.ts#L8)
7​
8## Type Parameters
9​
10### TFn
11​
12`TFn` *extends* [`AnyAsyncFunction`](../type-aliases/AnyAsyncFunction.md)
13​
14## Properties
15​
16### errorCount
17​
18```ts
19errorCount: number;
20```
21​
22Defined in: [async-rate-limiter.ts:12](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-rate-limiter.ts#L12)
23​
24Number of function executions that have resulted in errors
25​
26***
27​
28### executionTimes
29​
30```ts
31executionTimes: number[];
32```
33​
34Defined in: [async-rate-limiter.ts:16](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-rate-limiter.ts#L16)
35​
36Array of timestamps when executions occurred for rate limiting calculations
37​
38***
39​
40### isExceeded
41​
42```ts
43isExceeded: boolean;
44```
45​
46Defined in: [async-rate-limiter.ts:20](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-rate-limiter.ts#L20)
47​
48Whether the rate limiter has exceeded the limit
49​
50***
51​
52### isExecuting
53​
54```ts
55isExecuting: boolean;
56```
57​
58Defined in: [async-rate-limiter.ts:24](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-rate-limiter.ts#L24)
59​
60Whether the rate-limited function is currently executing asynchronously
61​
62***
63​
64### lastResult
65​
66```ts
67lastResult: Awaited<ReturnType<TFn>> | undefined;
68```
69​
70Defined in: [async-rate-limiter.ts:28](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-rate-limiter.ts#L28)
71​
72The result from the most recent successful function execution
73​
74***
75​
76### maybeExecuteCount
77​
78```ts
79maybeExecuteCount: number;
80```
81​
82Defined in: [async-rate-limiter.ts:48](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-rate-limiter.ts#L48)
83​
84Number of times maybeExecute has been called (for reduction calculations)
85​
86***
87​
88### rejectionCount
89​
90```ts
91rejectionCount: number;
92```
93​
94Defined in: [async-rate-limiter.ts:32](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-rate-limiter.ts#L32)
95​
96Number of function executions that have been rejected due to rate limiting
97​
98***
99​
100### settleCount
101​
102```ts
103settleCount: number;
104```
105​
106Defined in: [async-rate-limiter.ts:36](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-rate-limiter.ts#L36)
107​
108Number of function executions that have completed (either successfully or with errors)
109​
110***
111​
112### status
113​
114```ts
115status: "disabled" | "idle" | "executing" | "exceeded";
116```
117​
118Defined in: [async-rate-limiter.ts:40](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-rate-limiter.ts#L40)
119​
120Current execution status - 'disabled' when not active, 'executing' when executing, 'idle' when not executing, 'exceeded' when rate limit is exceeded
121​
122***
123​
124### successCount
125​
126```ts
127successCount: number;
128```
129​
130Defined in: [async-rate-limiter.ts:44](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-rate-limiter.ts#L44)
131​
132Number of function executions that have completed successfully