ColdStartManager class

Manages cold start synchronization behavior. Handles detection of cold starts and orchestrates appropriate sync strategies.

Constructors

ColdStartManager(ColdStartConfig _config, {DatumLogger? logger, ColdStartPersistence? persistence, int maxRetries = 3, Duration initialRetryDelay = const Duration(seconds: 5), double retryBackoffMultiplier = 2.0})

Properties

config ColdStartConfig
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getActiveUsers() Set<String>
Gets all users with cold start state.
getLastColdStartTimeForUser(String userId) DateTime?
Gets the last cold start time for a specific user.
handleColdStartIfNeeded(String? userId, Future<DatumSyncResult<DatumEntityInterface>> syncFunction(DatumSyncOptions<DatumEntityInterface>), {String? entityType, bool synchronous = false}) Future<bool>
Checks if this is a cold start and performs appropriate sync if needed. Now runs sync in background to prevent blocking app initialization.
isColdStartForUser(String userId) bool
Gets current cold start status for a specific user.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resetAll() → void
Resets cold start state for all users (useful for testing).
resetForUser(String userId) → void
Resets cold start state for a specific user (useful for testing).
setLastColdStartTimeForUser(String userId, DateTime? time) → void
Sets the last cold start time for a specific user (useful for testing).
toString() String
A string representation of this object.
inherited

Operators

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