use std::sync::atomic::AtomicBool;
use crate::Config;
pub(crate) struct RuntimeConfig {
pub(crate) enable_heartbeat: AtomicBool,
pub(crate) enable_elect: AtomicBool,
pub(crate) enable_pre_vote: AtomicBool,
}
impl RuntimeConfig {
pub(crate) fn new(config: &Config) -> Self {
Self {
enable_heartbeat: AtomicBool::from(config.enable_heartbeat),
enable_elect: AtomicBool::from(config.enable_elect),
enable_pre_vote: AtomicBool::from(config.get_enable_pre_vote()),
}
}
}