pub struct WalReceiver { /* private fields */ }Expand description
WAL Receiver manages the follower’s connection to the leader.
Implementations§
Source§impl WalReceiver
impl WalReceiver
Sourcepub fn new(
leader_addr: String,
wal_dir: impl Into<PathBuf>,
store: Arc<EventStore>,
) -> Result<Self>
pub fn new( leader_addr: String, wal_dir: impl Into<PathBuf>, store: Arc<EventStore>, ) -> Result<Self>
Create a new WAL receiver.
leader_addr is the host:port of the leader’s replication port (e.g. “core-leader:3910”).
wal_dir is the directory for the follower’s local WAL files.
Sourcepub fn set_metrics(&mut self, metrics: Arc<MetricsRegistry>)
pub fn set_metrics(&mut self, metrics: Arc<MetricsRegistry>)
Set the Prometheus metrics registry for replication metrics.
Sourcepub fn status(&self) -> FollowerReplicationStatus
pub fn status(&self) -> FollowerReplicationStatus
Get the current follower replication status for health reporting.
Sourcepub fn shutdown(&self)
pub fn shutdown(&self)
Signal the receiver to stop reconnecting and shut down.
Called during follower → leader promotion.
Auto Trait Implementations§
impl Freeze for WalReceiver
impl !RefUnwindSafe for WalReceiver
impl Send for WalReceiver
impl Sync for WalReceiver
impl Unpin for WalReceiver
impl UnsafeUnpin for WalReceiver
impl !UnwindSafe for WalReceiver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more