InitialSyncManager class
Event-driven initial sync manager. Listens to InitialSyncRequiredEvent from Fero server and orchestrates sync. Automatically handles log storage and conflict tracking.
- Implemented types
Constructors
-
InitialSyncManager({required Map<
String, InitialSyncHandler> handlers, RetryPolicy? retryPolicy, int maxRetries = 5, required int batchSize, required int maxBatchSize, required SyncMetaDataRepo metaRepo})
Properties
- batchSize → int
-
final
-
eventStream
→ Stream<
SyncEvent> -
Stream of sync events (from server and local operations).
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxBatchSize → int
-
final
- metaRepo → SyncMetaDataRepo
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → InitialSyncStatus
-
Current status of initial sync.
no setteroverride
-
statusStream
→ Stream<
InitialSyncStatus> -
Stream of status changes during initial sync.
no setteroverride
Methods
-
cancel(
) → void -
Cancel ongoing initial sync operation.
override
-
dispose(
) → void -
Dispose and cleanup resources.
override
-
emitEvent(
SyncEvent event) → void -
Manually emit a sync event (useful for testing or advanced scenarios).
override
-
getFeatureStatus(
String featureKey) → InitialSyncStatus? -
Get the sync status for a specific feature.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
) → Future< void> -
Run initial sync for all handlers.
override
-
startListeningToEvents(
) → Future< void> -
Listen to incoming sync events from Fero server.
This should be called once during app initialization.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited