浏览代码

Add a comment about threads.

Jing Yang 5 年之前
父节点
当前提交
92acf0470a
共有 1 个文件被更改,包括 4 次插入0 次删除
  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,