DatumConfig<T extends DatumEntityInterface> constructor

const DatumConfig<T extends DatumEntityInterface>({
  1. Duration autoSyncInterval = const Duration(minutes: 15),
  2. bool autoStartSync = false,
  3. Duration syncTimeout = const Duration(minutes: 2),
  4. DatumConflictResolver<T>? defaultConflictResolver,
  5. UserSwitchStrategy defaultUserSwitchStrategy = UserSwitchStrategy.syncThenSwitch,
  6. Future<String?> initialUserId()?,
  7. bool enableLogging = true,
  8. SyncDirection defaultSyncDirection = SyncDirection.pushThenPull,
  9. int schemaVersion = 0,
  10. List<Migration> migrations = const [],
  11. DatumSyncExecutionStrategy syncExecutionStrategy = const SequentialStrategy(),
  12. MigrationErrorHandler? onMigrationError,
  13. DatumSyncRequestStrategy syncRequestStrategy = const SequentialRequestStrategy(),
  14. DatumErrorRecoveryStrategy errorRecoveryStrategy = const DatumErrorRecoveryStrategy(shouldRetry: _defaultShouldRetry, maxRetries: 3, backoffStrategy: ExponentialBackoff()),
  15. Duration remoteEventDebounceTime = const Duration(milliseconds: 50),
  16. Duration changeCacheDuration = const Duration(seconds: 5),
  17. DatumSyncOptions<T>? defaultSyncOptions,
  18. int maxChangeCacheSize = 1000,
  19. Duration changeCacheCleanupInterval = const Duration(seconds: 30),
  20. int remoteSyncBatchSize = 100,
  21. int remoteStreamBatchSize = 50,
  22. int progressEventFrequency = 50,
  23. LogLevel logLevel = LogLevel.info,
  24. bool enablePerformanceLogging = false,
  25. Duration performanceLogThreshold = const Duration(milliseconds: 100),
  26. Map<String, LogSampler> logSamplers = const {},
  27. SyncDirectionResolver? syncDirectionResolver,
  28. ColdStartConfig coldStartConfig = const ColdStartConfig(),
})

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(),
});