Explorar o código

Add a comment about threads.

Jing Yang %!s(int64=5) %!d(string=hai) anos
pai
achega
92acf0470a
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/lib.rs

+ 4 - 0
src/lib.rs

@@ -126,6 +126,10 @@ struct AppendEntriesReply {
 }
 
 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>(
         peers: Vec<RpcClient>,
         me: usize,