RequestDeduplicator class

请求去重/防抖管理器 用于防止相同请求并发发送多次

Constructors

RequestDeduplicator({DeduplicationMode mode = DeduplicationMode.deduplication, Duration debounceDelay = const Duration(milliseconds: 300), Duration throttleInterval = const Duration(milliseconds: 300)})

Properties

debounceDelay Duration
防抖延迟时间(仅在 debounce 模式下有效)
final
hashCode int
The hash code for this object.
no setterinherited
mode DeduplicationMode
请求去重模式
final
pendingCount int
获取当前正在进行的请求数量
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
throttleInterval Duration
节流间隔时间(仅在 throttle 模式下有效)
final

Methods

clear() → void
清除所有缓存
clearRequest({required String method, required String path, Map<String, dynamic>? queryParameters, dynamic data}) → void
清除指定请求的缓存
execute<T>({required String method, required String path, Map<String, dynamic>? queryParameters, dynamic data, String? baseUrl, required Future<T> requestExecutor()}) Future<T>
执行请求(带去重/防抖/节流)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited