synq_manager library
Classes
- BackoffStrategy
- Abstract base class for retry backoff strategies.
-
ChangeDetail<
T extends SyncableEntity> - Represents a change that occurred in the data source. This is used to notify about external changes in cloud or remote adapters.
- ConflictContext
- Context information describing a synchronization conflict.
-
ConflictDetectedEvent<
T extends SyncableEntity> - Event emitted when the engine detects a conflict between local and remote data.
-
ConflictDetector<
T extends SyncableEntity> - Detects conflicts between local and remote data.
-
ConflictResolution<
T extends SyncableEntity> - Result of a conflict resolution attempt.
- ConnectivityChecker
- Wrapper around connectivity_plus to make it mockable.
-
DataChangeEvent<
T extends SyncableEntity> - Event emitted whenever local or remote data changes.
- ErrorRecoveryStrategy
- Strategy describing how the sync engine should behave on errors.
- ExponentialBackoff
- Implements an exponential backoff retry strategy.
- HashGenerator
- Utility for generating consistent hashes representing sync state.
- HealthCheck
- Health check result for the sync system.
-
IndexConfig<
T extends SyncableEntity> - Configuration for database indexes on syncable entities.
-
InitialSyncEvent<
T extends SyncableEntity> - Event emitted when event listeners are attached for a user and the full dataset snapshot needs to be delivered.
-
LastWriteWinsResolver<
T extends SyncableEntity> - Resolves conflicts by choosing the most recently modified version.
- LinearBackoff
- Implements a linear backoff retry strategy.
-
LocalAdapter<
T extends SyncableEntity> - Local storage adapter abstraction that provides access to offline data.
-
LocalPriorityResolver<
T extends SyncableEntity> - Resolves conflicts by always preferring the local version.
-
MergeResolver<
T extends SyncableEntity> - Resolver that allows subclasses to provide custom merge logic.
-
PaginatedResult<
T extends SyncableEntity> - Result of a paginated query.
- PaginationConfig
- Configuration for paginated queries.
-
QueueManager<
T extends SyncableEntity> - Manages the queue of pending sync operations per user.
-
RemoteAdapter<
T extends SyncableEntity> - Remote adapter abstraction for communicating with server-side data sources.
-
RemotePriorityResolver<
T extends SyncableEntity> - Resolves conflicts by always preferring the remote version.
- SyncableEntity
- Base contract for entities that participate in synchronization.
-
SyncCompletedEvent<
T extends SyncableEntity> - Event emitted when a sync operation completes.
-
SyncConflictResolver<
T extends SyncableEntity> - Base interface for components that resolve synchronization conflicts.
-
SyncConflictSummary<
T extends SyncableEntity> - Description of a conflict encountered during a sync.
-
SyncEngine<
T extends SyncableEntity> - Engine responsible for executing synchronization operations between local and remote data sources.
-
SyncErrorEvent<
T extends SyncableEntity> - Event emitted when a sync error occurs.
-
SyncEvent<
T extends SyncableEntity> - Base class for all events emitted by the synchronization system.
- SyncMetadata
- Metadata describing the synchronization state for a specific user.
-
SyncOperation<
T extends SyncableEntity> - Representation of a local operation that needs to be synchronized remotely.
- SyncOptions
- Configuration passed when triggering manual synchronization.
-
SyncProgressEvent<
T extends SyncableEntity> - Event emitted during sync to report progress.
- SyncResult
- Result produced after a sync cycle finishes.
-
SyncStartedEvent<
T extends SyncableEntity> - Event emitted when a sync operation starts.
- SyncStatistics
- Aggregated statistics about multiple sync cycles.
-
SyncStatusDetails<
T extends SyncableEntity> - Detailed status information for sync operations.
- SyncStatusSnapshot
- Snapshot describing the current sync state for a user.
- SynqConfig
- Configuration for SynqManager behavior.
- SynqLogger
- Lightweight logger abstraction to avoid pulling in heavy dependencies.
-
SynqManager<
T extends SyncableEntity> - Orchestrates bidirectional synchronization between local and remote data stores.
- SynqMetrics
- Tracks metrics and statistics for sync operations.
-
SynqMiddleware<
T extends SyncableEntity> - Middleware for intercepting and modifying sync operations.
-
SynqQuery<
T extends SyncableEntity> - Fluent query builder for syncable entities.
-
UserPromptResolver<
T extends SyncableEntity> - Resolves conflicts by prompting the user to choose.
-
UserSwitchedEvent<
T extends SyncableEntity> - Event emitted when the active user is changed in the manager.
- UserSwitchResult
- Result of a user switching operation.
Enums
- ChangeType
- Type of data change.
- ConflictType
- Types of conflicts detected between local and remote representations.
- DataSource
- Source of data change.
- HealthStatus
- Overall health status levels.
- LogLevel
- Logging levels.
- ResolutionStrategy
- Strategies used when resolving conflicts.
- SyncHealth
- Sync health status levels.
- SyncOperationStatus
- Current status of a queued operation.
- SyncOperationType
- Type of operation recorded in the sync queue.
- SyncStatus
- High level states for synchronization.
- UserSwitchStrategy
- Strategies available when switching between users.
Typedefs
-
Predicate<
T> = bool Function(T) - Predicate function type for filtering.
-
Selector<
T, R extends Comparable< Object?> > = R Function(T) - Selector function type for ordering.
Exceptions / Errors
- AdapterException
- Exception thrown by adapters during data operations.
- ConflictException
- Exception thrown when a data conflict is detected.
- NetworkException
- Exception thrown when network-related errors occur.
- SynqException
- Base class for all SynqManager-specific exceptions.
- UserSwitchException
- Exception thrown during user switching operations.
- ValidationException
- Exception thrown when data validation fails.