RequestQueue class
请求队列管理器 用于管理请求队列、优先级和并发数限制
Constructors
- RequestQueue({int maxConcurrency = 10})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isPaused → bool
-
是否已暂停
no setter
- maxConcurrency → int
-
最大并发数(默认 10)
final
- queueLength → int
-
当前队列长度
no setter
- runningCount → int
-
当前正在执行的请求数量
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
statusStream
→ Stream<
QueueStatus> -
队列状态流
no setter
Methods
-
clear(
) → void - 清空队列(取消所有待执行的请求)
-
dispose(
) → void - 释放资源
-
enqueue<
T> ({int priority = 0, required Future< T> requestExecutor()}) → Future<T> - 添加请求到队列
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → void - 暂停队列(不再执行新请求,但正在执行的请求会继续)
-
resume(
) → void - 恢复队列(继续执行队列中的请求)
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited