Ver Fonte

Add a comment about threads.

Jing Yang há 5 anos atrás
pai
commit
92acf0470a
1 ficheiros alterados com 4 adições e 0 exclusões
  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,