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
use Arc;
/// Confirms that one [`Change`](super::Change) was durably processed downstream
/// — written to the sink and checkpointed. Returned inside every change.
///
/// Each change carries a monotonically increasing sequence number. The
/// mechanism only advances its durable resume point (for WAL, a replication
/// slot's `confirmed_flush_lsn`) to the highest **contiguous** confirmed
/// sequence. Confirming out of order is therefore safe: a gap simply holds the
/// resume point back until it is filled, and nothing already confirmed is
/// re-sent.
///
/// Dropping an `Ack` without calling [`confirm`](Self::confirm) does *not*
/// confirm the change. It will be redelivered after a restart — this is the
/// at-least-once guarantee.
/// The mechanism-side endpoint an [`Ack`] reports back to.
///
/// Implemented in the source crate — for example, mapping a sequence number to
/// its LSN and advancing the replication slot once the confirmed sequences are
/// contiguous. Implementations must be cheap to call and safe to call out of
/// order.
// The design depends on an `Ack` being movable across threads/tasks and held
// arbitrarily long before [`Ack::confirm`] is called — confirmation happens
// externally, asynchronously, and out of order. Lock that property in at
// compile time so it can never silently regress (e.g. if `AckSink` ever lost
// its `Send + Sync` bound).
const _: = ;