Prechádzať zdrojové kódy

Add a comment to explain what put_append returns.

Jing Yang 4 rokov pred
rodič
commit
e16cb2f9ec
1 zmenil súbory, kde vykonal 9 pridanie a 0 odobranie
  1. 9 0
      kvraft/src/client.rs

+ 9 - 0
kvraft/src/client.rs

@@ -191,6 +191,15 @@ impl ClerkInner {
         }
     }
 
+    /// This function returns None when
+    /// 1. No KVServer can be reached, or
+    /// 2. No KVServer claimed to be the leader.
+    ///
+    /// Some(()) is returned if the request has been committed previously, under
+    /// the assumption is that two different requests with the same unique_id
+    /// must be identical.
+    ///
+    /// This function do not expect a Conflict request with the same unique_id.
     fn put_append(
         &mut self,
         key: String,