Skip to main content

Module engine

Module engine 

Source
Expand description

The replication engine: reader task, applier loop, and reconnect policy.

Guarantees:

  • Events are applied in the order the source produced them.
  • A source transaction is applied atomically together with its checkpoint.
  • WAL positions are acknowledged only after the corresponding target commit returned.
  • Redelivered transactions (after crash/reconnect) are skipped by LSN comparison.
  • Memory held by undelivered events is bounded by the channel limits.

Structs§

AckPosition
Position the reader reports to the server. Only acked is ever reported as flushed.
ApplyOutcome

Functions§

run_apply_loop
Runs one connected stream until cancellation or error.
run_replication
Reconnecting driver: opens a stream and a sink, runs the apply loop, and on transient failures reloads the checkpoint from the sink (the source of truth) and reconnects.