pub struct FailureDetectorConfig {
pub protocol_period: Duration,
pub ping_timeout: Duration,
pub ping_req_count: usize,
pub suspect_timeout: Duration,
pub gossip_fanout: usize,
}Expand description
Configuration for the SWIM-based failure detector.
Replaces the old simple ping-count model with the full SWIM protocol: protocol periods, indirect pings, suspicion with timeout, and gossip piggybacking.
Fields§
§protocol_period: DurationHow often the protocol runs a probe cycle.
ping_timeout: DurationTimeout for a direct ping response.
ping_req_count: usizeNumber of random peers to ask for an indirect ping when a direct ping fails.
suspect_timeout: DurationHow long a member stays in “suspect” state before being declared dead.
gossip_fanout: usizeMaximum number of gossip updates piggybacked per protocol message.
Implementations§
Source§impl FailureDetectorConfig
impl FailureDetectorConfig
Sourcepub fn from_legacy(
ping_interval: Duration,
ping_timeout: Duration,
max_missed_pings: u32,
) -> Self
pub fn from_legacy( ping_interval: Duration, ping_timeout: Duration, max_missed_pings: u32, ) -> Self
Migrate from the pre-SWIM config fields.
Maps old field names to the SWIM equivalents:
ping_interval->protocol_periodping_timeout->ping_timeout(unchanged)max_missed_pings->suspect_timeout(computed asping_interval * max_missed_pings)
New SWIM-specific fields (ping_req_count, gossip_fanout) use defaults.
Trait Implementations§
Source§impl Clone for FailureDetectorConfig
impl Clone for FailureDetectorConfig
Source§fn clone(&self) -> FailureDetectorConfig
fn clone(&self) -> FailureDetectorConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FailureDetectorConfig
impl Debug for FailureDetectorConfig
Auto Trait Implementations§
impl Freeze for FailureDetectorConfig
impl RefUnwindSafe for FailureDetectorConfig
impl Send for FailureDetectorConfig
impl Sync for FailureDetectorConfig
impl Unpin for FailureDetectorConfig
impl UnsafeUnpin for FailureDetectorConfig
impl UnwindSafe for FailureDetectorConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request