Browse Source

chore(peer_server): more explanation for asyncRemove

Yicheng Qin 11 years ago
parent
commit
5465201292
1 changed files with 4 additions and 1 deletions
  1. 4 1
      server/peer_server.go

+ 4 - 1
server/peer_server.go

@@ -304,8 +304,11 @@ func (s *PeerServer) Stop() {
 }
 
 // asyncRemove stops the server in peer mode.
-// It is called to stop the server because it has been removed
+// It is called to stop the server internally when it has been removed
 // from the cluster.
+// The function triggers the stop action first to notice server that it
+// should not continue, and wait for its stop in separate goroutine because
+// the caller should also exit.
 func (s *PeerServer) asyncRemove() {
 	s.Lock()
 	if !s.started {