Browse Source

Add a comment about threads.

Jing Yang 5 years ago
parent
commit
92acf0470a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/lib.rs

+ 4 - 0
src/lib.rs

@@ -126,6 +126,10 @@ struct AppendEntriesReply {
 }
 }
 
 
 impl Raft {
 impl Raft {
+    /// Create a new raft instance.
+    ///
+    /// Each instance will create at least 3 + (number of peers) threads. The
+    /// extensive usage of threads is to minimize latency.
     pub fn new<Func>(
     pub fn new<Func>(
         peers: Vec<RpcClient>,
         peers: Vec<RpcClient>,
         me: usize,
         me: usize,