Browse Source

etcdserver: add docs

Blake Mizerany 11 years ago
parent
commit
ba7d174349
1 changed files with 6 additions and 0 deletions
  1. 6 0
      etcdserver2/server.go

+ 6 - 0
etcdserver2/server.go

@@ -88,10 +88,16 @@ func (s *Server) run() {
 	}
 }
 
+// Stop stops the server, and shutsdown the running goroutine. Stop should be
+// called after a Start(s), otherwise it will block forever.
 func (s *Server) Stop() {
 	s.done <- struct{}{}
 }
 
+// Do interprets r and performs an operation on s.Store according to r.Method
+// and other fields. If r.Method is "PUT", "PUT", or "DELETE, r will be sent
+// through consensus before performing its respective operation. Do will block
+// until an action is performed or there is an error.
 func (s *Server) Do(ctx context.Context, r pb.Request) (Response, error) {
 	if r.Id == 0 {
 		panic("r.Id cannot be 0")