Module batch

Module batch 

Source
Expand description

Batch processor for CDC events.

Collects events with key deduplication (latest wins) and flushes to sync-engine in batches for efficiency.

§Design

CDC Events ──┬──▶ BatchProcessor ──┬──▶ Debounce (time/count)
             │                     │
             │ HashMap<key, state> │
             │ (latest wins)       │
             │                     ▼
             └─────────────────────┼──▶ Parallel is_current() dedup
                                   │
                                   ▼
                     submit_many() / delete_many()

Structs§

BatchConfig
Configuration for batch processing.
BatchProcessor
Accumulates CDC events and flushes to sync-engine in batches.
BatchResult
Result of processing a batch.
SharedBatchProcessor
Thread-safe wrapper around BatchProcessor.