tender 0.1.1

A Raft-based election framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::error::Result;

/// Thread used for election main thread.
pub trait Thread: Sized {
    fn spawn<F>(name: String, f: F) -> Result<Self>
    where
        F: FnOnce(),
        F: Send + 'static;
    fn join(self);
}

/// Spawner for internal short-time task.
pub trait TaskSpawner {
    fn spawn<F>(&self, name: String, f: F) -> Result<()>
    where
        F: FnOnce(),
        F: Send + 'static;
}