DatumSyncEngine<T extends DatumEntityInterface> class

The core engine that orchestrates the synchronization process.

Constructors

DatumSyncEngine({required LocalAdapter<T> localAdapter, required RemoteAdapter<T> remoteAdapter, required DatumConflictResolver<T> conflictResolver, required QueueManager<T> queueManager, required DatumConflictDetector<T> conflictDetector, required DatumLogger logger, required DatumConfig<DatumEntityInterface> config, required DatumConnectivityChecker connectivityChecker, required StreamController<DatumSyncEvent<T>> eventController, required BehaviorSubject<DatumSyncStatusSnapshot> statusSubject, required BehaviorSubject<DatumSyncMetadata> metadataSubject, required IsolateHelper isolateHelper, List<DatumObserver<T>> localObservers = const [], List<GlobalDatumObserver> globalObservers = const [], String? deviceId, MetadataHashCache? hashCache})

Properties

config DatumConfig<DatumEntityInterface>
final
conflictDetector DatumConflictDetector<T>
final
conflictResolver DatumConflictResolver<T>
final
connectivityChecker DatumConnectivityChecker
final
deviceId String?
final
entityName String
no setter
eventController StreamController<DatumSyncEvent<T>>
final
globalObservers List<GlobalDatumObserver>
final
hashCache MetadataHashCache
Cached per-user content hash/count; shared with the owning manager so its CRUD chokepoints can invalidate entries.
final
hashCode int
The hash code for this object.
no setterinherited
isolateHelper IsolateHelper
final
isSyncing bool
Returns true if a synchronization process is currently active.
no setter
lastActiveUserId String?
no setter
localAdapter LocalAdapter<T>
final
localObservers List<DatumObserver<T>>
final
logger DatumLogger
final
metadataSubject → BehaviorSubject<DatumSyncMetadata>
final
queueManager QueueManager<T>
final
remoteAdapter RemoteAdapter<T>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusSubject → BehaviorSubject<DatumSyncStatusSnapshot>
final

Methods

checkForUserSwitch(String newUserId) Future<void>
Checks if the active user has changed and emits an event if so.
checkHealth() Future<DatumHealth>
Performs a health check on the local and remote adapters.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
synchronize(String userId, {bool force = false, DatumSyncOptions<T>? options, DatumSyncScope? scope}) FutureOr<(DatumSyncResult<T>, List<DatumSyncEvent<T>>)>
toString() String
A string representation of this object.
inherited

Operators

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

Constants

syncCursorKey → const String
The reserved key holding the incremental-pull cursor inside sync metadata customMetadata.