1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! [`CdcConsumer`] trait — polling interface for CDC event streams.
//!
//! The default implementation in `rhei-oltp-rusqlite` reads from the
//! `_rhei_cdc_log` SQLite table populated by triggers. Alternative backends
//! (e.g., WAL-based or RocksDB-backed) implement this same trait.
use crateCdcEvent;
/// Consumes CDC (Change Data Capture) events from the OLTP engine.
///
/// The default implementation uses trigger-based CDC with a `_rhei_cdc_log`
/// table. Future implementations may use WAL-based approaches.
///
/// # Contract for implementors
///
/// - [`poll`](CdcConsumer::poll) must return events in ascending
/// [`CdcEvent::seq`] order.
/// - [`prune`](CdcConsumer::prune) must be idempotent: pruning an already-
/// pruned range must not error.
/// - All methods must be `Send` so they can be called from async tasks.