Skip to main content

Module replay_loop

Module replay_loop 

Source

Structsยง

ReplayProgress
Tracks how far behind the standby is from the primary.

Constantsยง

CATCH_UP_TICK_INTERVAL ๐Ÿ”’

Traitsยง

ReplayHandler
Callback that the replay loop calls for each command. The implementation should deserialize and call apply() on the standby engine.

Functionsยง

apply_replay_message ๐Ÿ”’
is_caught_up_to_stream_tail ๐Ÿ”’
is_promote_signal ๐Ÿ”’
Check if the shutdown signal is a real promote (Ok) vs sender dropped (Err). Only returns true for an explicit promote signal.
refresh_catch_up_state ๐Ÿ”’
run_replay_loop
Runs the standby replay loop: subscribes to NATS JetStream and continuously replays engine commands to keep the standby engine caught up with the primary.