CloudSyncService class
Service for syncing logs to a cloud backend.
Features:
- Automatic batching with configurable size and interval
- Retry logic with exponential backoff
- Priority queue for error logs
- Offline queue management
- Thread-safe operations
Constructors
- CloudSyncService({required CloudSyncConfig config, Client? client})
Properties
- config → CloudSyncConfig
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- onError ↔ void Function(String error, int retryCount)?
-
Callback for sync errors.
getter/setter pair
- onStatusChanged ↔ void Function(CloudSyncStatus)?
-
Callback for sync status changes.
getter/setter pair
- pendingCount → int
-
Get the current queue size.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → CloudSyncStatus
-
Get the current sync status.
no setter
Methods
-
dispose(
) → void - Dispose resources.
-
flush(
) → Future< bool> - Manually trigger a sync of all pending logs.
-
initialize(
) → void - Initialize the sync service and start the batch timer.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
queueLog(
LogEntry log) → void - Queue a log entry for syncing.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited