lol-core 0.9.5

A Raft implementation in Rust language.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use tokio::sync::oneshot;

pub struct CommitOk;
pub struct ApplyOk(pub Vec<u8>);
pub enum Ack {
    OnCommit(oneshot::Sender<CommitOk>),
    OnApply(oneshot::Sender<ApplyOk>),
}
pub fn channel_for_commit() -> (Ack, oneshot::Receiver<CommitOk>) {
    let (tx, rx) = oneshot::channel::<CommitOk>();
    (Ack::OnCommit(tx), rx)
}
pub fn channel_for_apply() -> (Ack, oneshot::Receiver<ApplyOk>) {
    let (tx, rx) = oneshot::channel::<ApplyOk>();
    (Ack::OnApply(tx), rx)
}