pub struct BridgeConfig {
pub log_changes: bool,
pub auto_promote: bool,
pub static_seeds: Vec<SocketAddr>,
pub lazarus_enabled: bool,
pub lazarus_interval: Duration,
pub persistence_path: Option<PathBuf>,
}Expand description
Configuration for the Plumtree bridge.
Fields§
§log_changes: boolWhether to log topology changes.
auto_promote: boolWhether to automatically promote new peers to eager based on fanout settings.
static_seeds: Vec<SocketAddr>Static seed addresses for the cluster.
These seeds will be periodically probed by the Lazarus task to ensure that restarted seeds are automatically rediscovered.
lazarus_enabled: boolEnable the Lazarus background task for seed recovery.
When enabled, the bridge will periodically check if static seeds are alive and attempt to rejoin them if they’re missing from the cluster.
lazarus_interval: DurationInterval between Lazarus probes for dead seeds.
Default: 30 seconds
persistence_path: Option<PathBuf>Path to persist known peers for recovery after restart.
If set, the bridge will save known peer addresses to this file on shutdown and load them on startup.
Implementations§
Source§impl BridgeConfig
impl BridgeConfig
Sourcepub fn with_log_changes(self, log: bool) -> Self
pub fn with_log_changes(self, log: bool) -> Self
Enable or disable logging of topology changes.
Sourcepub fn with_auto_promote(self, auto: bool) -> Self
pub fn with_auto_promote(self, auto: bool) -> Self
Enable or disable automatic promotion of new peers.
Sourcepub fn with_static_seeds(self, seeds: Vec<SocketAddr>) -> Self
pub fn with_static_seeds(self, seeds: Vec<SocketAddr>) -> Self
Set static seed addresses for the cluster.
These seeds will be periodically probed by the Lazarus task (if enabled) to ensure restarted seeds are automatically rediscovered.
§Example
use memberlist_plumtree::BridgeConfig;
let config = BridgeConfig::new()
.with_static_seeds(vec![
"192.168.1.100:7946".parse().unwrap(),
"192.168.1.101:7946".parse().unwrap(),
]);Sourcepub fn with_lazarus_enabled(self, enabled: bool) -> Self
pub fn with_lazarus_enabled(self, enabled: bool) -> Self
Enable or disable the Lazarus background task for seed recovery.
When enabled, the bridge will periodically probe static seeds and attempt to rejoin any that are not in the cluster’s alive set.
Sourcepub fn with_lazarus_interval(self, interval: Duration) -> Self
pub fn with_lazarus_interval(self, interval: Duration) -> Self
Set the interval between Lazarus probes for dead seeds.
Default: 30 seconds. Lower values provide faster recovery but increase network overhead.
Sourcepub fn with_persistence_path(self, path: PathBuf) -> Self
pub fn with_persistence_path(self, path: PathBuf) -> Self
Set the path for persisting known peers.
When set, the bridge will save known peer addresses to this file on shutdown and load them on startup, providing additional bootstrap options beyond static seeds.
Sourcepub fn should_run_lazarus(&self) -> bool
pub fn should_run_lazarus(&self) -> bool
Check if Lazarus probing is enabled and has seeds configured.
Trait Implementations§
Source§impl Clone for BridgeConfig
impl Clone for BridgeConfig
Source§fn clone(&self) -> BridgeConfig
fn clone(&self) -> BridgeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BridgeConfig
impl Debug for BridgeConfig
Auto Trait Implementations§
impl Freeze for BridgeConfig
impl RefUnwindSafe for BridgeConfig
impl Send for BridgeConfig
impl Sync for BridgeConfig
impl Unpin for BridgeConfig
impl UnwindSafe for BridgeConfig
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
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> ⓘ
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> ⓘ
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