框架
版本
防抖器 API 参考
节流器 API 参考
速率限制器 API 参考
队列 API 参考
批处理器 API 参考

异步节流器状态

接口: AsyncThrottlerState<TFn>

定义于: async-throttler.ts:6

类型参数

TFn extends AnyAsyncFunction

属性

errorCount

ts
errorCount: number;
errorCount: number;

定义于: async-throttler.ts:10

导致错误的函数执行次数


isExecuting

ts
isExecuting: boolean;
isExecuting: boolean;

定义于: async-throttler.ts:14

节流函数是否正在异步执行


isPending

ts
isPending: boolean;
isPending: boolean;

定义于: async-throttler.ts:18

节流器是否正在等待超时以触发执行


lastArgs

ts
lastArgs: undefined | Parameters<TFn>;
lastArgs: undefined | Parameters<TFn>;

定义于: async-throttler.ts:22

最近一次调用 maybeExecute 的参数


lastExecutionTime

ts
lastExecutionTime: number;
lastExecutionTime: number;

定义于: async-throttler.ts:26

上次函数执行的时间戳(毫秒)


lastResult

ts
lastResult: undefined | ReturnType<TFn>;
lastResult: undefined | ReturnType<TFn>;

定义于: async-throttler.ts:30

最近一次成功函数执行的结果


maybeExecuteCount

ts
maybeExecuteCount: number;
maybeExecuteCount: number;

定义于: async-throttler.ts:34

调用 maybeExecute 的次数(用于计算减少)


nextExecutionTime

ts
nextExecutionTime: undefined | number;
nextExecutionTime: undefined | number;

定义于: async-throttler.ts:38

下次可以执行的时间戳(毫秒)


settleCount

ts
settleCount: number;
settleCount: number;

定义于: async-throttler.ts:42

已完成的函数执行次数(包括成功或错误)


status

ts
status: "disabled" | "idle" | "pending" | "executing" | "settled";
status: "disabled" | "idle" | "pending" | "executing" | "settled";

定义于: async-throttler.ts:46

当前执行状态 - 'idle' 表示空闲,'pending' 表示等待,'executing' 表示正在执行,'settled' 表示已完成


successCount

ts
successCount: number;
successCount: number;

定义于: async-throttler.ts:50

成功完成的函数执行次数

我们的合作伙伴
Code Rabbit
Unkey
订阅 Bytes

您的每周 JavaScript 资讯。每周一免费发送给超过 10 万开发者。

Bytes

无垃圾邮件。您可以随时取消订阅。

订阅 Bytes

您的每周 JavaScript 资讯。每周一免费发送给超过 10 万开发者。

Bytes

无垃圾邮件。您可以随时取消订阅。