Expand description
Sync engine coordinator.
The SyncEngine is the main orchestrator that ties together all components:
- L1 in-memory cache with eviction
- L2 Redis cache with batch writes
- L3 MySQL/SQLite archive with WAL durability
- Cuckoo filters for existence checks
- Merkle trees for sync verification
§Lifecycle
Created → Connecting → DrainingWal → SyncingRedis → WarmingUp → Ready → Running → ShuttingDown§Example
use sync_engine::{SyncEngine, SyncEngineConfig, SyncItem, EngineState};
use serde_json::json;
use tokio::sync::watch;
let config = SyncEngineConfig::default();
let (_tx, rx) = watch::channel(config.clone());
let mut engine = SyncEngine::new(config, rx);
assert_eq!(engine.state(), EngineState::Created);
// engine.start().await.expect("Start failed");
// assert!(engine.is_ready());Structs§
- Batch
Result - Result of a batch operation.
- Health
Check - Comprehensive health status of the sync engine.
- Merkle
Diff - Result of comparing merkle trees between two nodes.
- Search
Result - Search result with metadata
- Sync
Engine - Main sync engine coordinator.
Enums§
- Engine
State - Engine lifecycle state.
- Item
Status - Sync status of an item across storage tiers.
- Search
Source - Where search results came from
- Search
Tier - Search tier strategy