DatumConfig<T extends DatumEntityInterface> constructor
const
DatumConfig<T extends DatumEntityInterface> ({
- Duration autoSyncInterval = const Duration(minutes: 15),
- bool autoStartSync = false,
- Duration syncTimeout = const Duration(minutes: 2),
- DatumConflictResolver<
T> ? defaultConflictResolver, - UserSwitchStrategy defaultUserSwitchStrategy = UserSwitchStrategy.syncThenSwitch,
- Future<
String?> initialUserId()?, - bool enableLogging = true,
- SyncDirection defaultSyncDirection = SyncDirection.pushThenPull,
- int schemaVersion = 0,
- List<
Migration> migrations = const [], - DatumSyncExecutionStrategy syncExecutionStrategy = const SequentialStrategy(),
- MigrationErrorHandler? onMigrationError,
- DatumSyncRequestStrategy syncRequestStrategy = const SequentialRequestStrategy(),
- DatumErrorRecoveryStrategy errorRecoveryStrategy = const DatumErrorRecoveryStrategy(shouldRetry: _defaultShouldRetry, maxRetries: 3, backoffStrategy: ExponentialBackoff()),
- Duration remoteEventDebounceTime = const Duration(milliseconds: 50),
- Duration changeCacheDuration = const Duration(seconds: 5),
- DatumSyncOptions<
T> ? defaultSyncOptions, - int maxChangeCacheSize = 1000,
- Duration changeCacheCleanupInterval = const Duration(seconds: 30),
- int remoteSyncBatchSize = 100,
- int remoteStreamBatchSize = 50,
- int progressEventFrequency = 50,
- LogLevel logLevel = LogLevel.info,
- bool enablePerformanceLogging = false,
- Duration performanceLogThreshold = const Duration(milliseconds: 100),
- Map<
String, LogSampler> logSamplers = const {}, - SyncDirectionResolver? syncDirectionResolver,
- ColdStartConfig coldStartConfig = const ColdStartConfig(),
- DeleteBehavior deleteBehavior = DeleteBehavior.hardDelete,
Implementation
const DatumConfig({
this.autoSyncInterval = const Duration(minutes: 15),
this.autoStartSync = false,
this.syncTimeout = const Duration(minutes: 2),
this.defaultConflictResolver,
this.defaultUserSwitchStrategy = UserSwitchStrategy.syncThenSwitch,
this.initialUserId,
this.enableLogging = true,
this.defaultSyncDirection = SyncDirection.pushThenPull,
this.schemaVersion = 0,
this.migrations = const [],
this.syncExecutionStrategy = const SequentialStrategy(),
this.onMigrationError,
this.syncRequestStrategy = const SequentialRequestStrategy(),
this.errorRecoveryStrategy = const DatumErrorRecoveryStrategy(
shouldRetry: _defaultShouldRetry,
maxRetries: 3,
backoffStrategy: ExponentialBackoff(),
),
this.remoteEventDebounceTime = const Duration(milliseconds: 50),
this.changeCacheDuration = const Duration(seconds: 5),
this.defaultSyncOptions,
this.maxChangeCacheSize = 1000,
this.changeCacheCleanupInterval = const Duration(seconds: 30),
this.remoteSyncBatchSize = 100,
this.remoteStreamBatchSize = 50,
this.progressEventFrequency = 50,
this.logLevel = LogLevel.info,
this.enablePerformanceLogging = false,
this.performanceLogThreshold = const Duration(milliseconds: 100),
this.logSamplers = const {},
this.syncDirectionResolver,
this.coldStartConfig = const ColdStartConfig(),
this.deleteBehavior = DeleteBehavior.hardDelete,
});