SequentialRequestStrategy class
A strategy that queues new sync requests if one is already in progress.
This ensures that all requested syncs are executed sequentially, one after the other, preventing lost updates from rapid, concurrent calls. This is the recommended default for most applications to ensure data consistency.
- Implemented types
Constructors
- SequentialRequestStrategy({int retryCount = 3})
-
Creates a sequential strategy with an optional
retryCount.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- retryCount → int
-
The number of times to retry a failed synchronization action.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void -
Disposes of any resources held by the strategy.
override
-
execute<
T> (Future< T> action(), {required bool isSyncInProgress(), required T onSkipped()}) → Future<T> -
Executes the given
actionaccording to the strategy's rules.override -
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