Explorar o código

Add a comment to explain what put_append returns.

Jing Yang %!s(int64=4) %!d(string=hai) anos
pai
achega
e16cb2f9ec
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  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,