SlowlyMx mixin
Mixin for debounce, throttle and Mutex lock.
This implementation is powered by Slowly.
- Superclass constraints
- Mixin applications
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
debounce<
R> (Object tag, Duration duration, FutureOr< R> action(), {Duration? maxDuration}) → FutureOr<R?> -
debounce 防抖: 停止操作后等待
duration执行最后一次。maxDuration: 可选,解决“无限重置”问题。如果持续触发超过此时间,强制执行一次。 -
dispose(
) → void -
取消所有定时器并清除锁
override
-
frPrint(
String message, {DateTime? time, int? sequenceNumber, int? level, String? name, Zone? zone, Object? error, StackTrace? stackTrace}) → dynamic -
inherited
-
isDebounceLocked(
Object tag) → bool - 检查是否正在防抖等待中
-
isMutexLocked(
Object tag) → bool - 检查是否正在执行 mutex 任务
-
isThrottleLocked(
Object tag) → bool - 检查是否处于节流冷却期
-
logF(
String message, {LogExtra? logExtra, Object? error, StackTrace? stackTrace, DateTime? time, int? sequenceNumber, String? name, Zone? zone}) → void -
inherited
-
logger(
String message, {LogExtra? logExtra, DateTime? time, int? sequenceNumber, int level = 800, String? name, Zone? zone, Object? error, StackTrace? stackTrace, bool uriFrame = true}) → dynamic -
logExtraprint stack frame infonamelogger.name null: will use 'runtimeType'stackTracewill print with red color by dev.log but iferror== null: will ignorestackTraceinherited -
logI(
String message, {LogExtra? logExtra, Object? error, StackTrace? stackTrace, DateTime? time, int? sequenceNumber, String? name, Zone? zone}) → void -
inherited
-
logS(
String message, {LogExtra? logExtra, Object? error, StackTrace? stackTrace, DateTime? time, int? sequenceNumber, String? name, Zone? zone}) → void -
for debug 'shout'
inherited
-
mutex<
R> (Object tag, FutureOr< R> action()) → FutureOr<R?> - mutex 互斥锁 (Exhaust): 立即执行,执行期间的触发直接丢弃。
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
throttle<
R> (Object tag, Duration duration, FutureOr< R> action(), {bool ensureLast = false}) → FutureOr<R?> -
throttle 节流: 固定频率执行。
配合 mutex 解决异步任务重叠问题:如果周期到了但上次任务还没跑完,直接跳过。
ensureLast: 如果为 true,则在节流期间的最后一次触发将被防抖补发。 -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited