BackgroundSyncManager class

Incremental sync manager for background/continuous syncing. Handles priority-based, dependency-aware, and concurrent sync operations.

Follows SOLID principles:

  • Single Responsibility: Orchestrates background sync workflows
  • Open/Closed: Extensible via FeatureSyncConfig without modification
  • Liskov Substitution: Works with any BackgroundSyncHandler implementation
  • Interface Segregation: Depends only on specific interfaces it needs
  • Dependency Inversion: Depends on abstractions (interfaces), not concrete classes

Constructors

BackgroundSyncManager({required Map<String, FeatureSyncConfig> featureConfigs, required SyncMetaDataRepo metaRepo, BackoffStrategy? backoffStrategy, int maxRetries = 3, int maxConcurrent = 2, int batchSize = 50, ConflictResolutionStrategy conflictStrategy = ConflictResolutionStrategy.highestVersionWins})

Properties

batchSize int
final
conflictStrategy ConflictResolutionStrategy
final
eventStream Stream<SyncEvent>
no setter
hashCode int
The hash code for this object.
no setterinherited
metaRepo SyncMetaDataRepo
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
syncAll() → void
Start sync for all features, respecting priority, concurrency, and dependencies.
syncFeature(String featureKey) → void
Start background sync for a specific feature. Respects concurrency limits, priority ordering, and dependencies.
toString() String
A string representation of this object.
inherited

Operators

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