Skip to main content

run_replay_loop

Function run_replay_loop 

Source
pub async fn run_replay_loop<H: ReplayHandler>(
    config: &NatsConfig,
    start_from_seq: i64,
    handler: H,
    progress: ReplayProgress,
    shutdown: Receiver<()>,
) -> Result<H>
Expand description

Runs the standby replay loop: subscribes to NATS JetStream and continuously replays engine commands to keep the standby engine caught up with the primary.

Returns the handler ONLY when an explicit promote signal fires. Ignores sender drops and stream disconnects — only POST /admin/promote can cause this function to return.