-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.rs
28 lines (24 loc) · 793 Bytes
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//! Replication is achieved through a simplistic leader/follower model.
//!
//! The [`ReplicatedServer`] is the designated leader and will use its internally
//! configured [`RemoteNodeClient`]'s to replicate `set` and `remove` calls from
//! remote stores.
//!
//! The expectation is that the [`ReplicatedServer`] is the direct contact for
//! updates and whilst any node can serve a `get`, there is no guarantee that
//! the read is not stale.
mod server;
pub use server::ReplicatedServer;
#[derive(Debug, Clone, clap::ValueEnum)]
pub enum Mode {
Leader,
Follower,
}
impl From<Mode> for clap::builder::OsStr {
fn from(value: Mode) -> Self {
match value {
Mode::Leader => "leader".into(),
Mode::Follower => "follower".into(),
}
}
}