RequestDeduplicator class
Prevents accidental duplicate calls to the same logical operation — e.g. a user double-tapping "Submit" before the first tap's request has returned.
Deduplication is keyed by a caller-supplied key (e.g.
'create_order'); calls with no key are never deduplicated.
Constructors
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
-
isInFlight(
String key) → bool -
Whether a call with
keyis currently in flight. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Clears all tracked in-flight entries without cancelling the underlying futures. Mainly useful for tests.
-
run<
T> (String? key, Future< T> operation(), {DeduplicationPolicy policy = DeduplicationPolicy.reuseInFlight}) → Future<T> -
Runs
operationunderkeyaccording topolicy. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited