Browse Source

refactor add comments for receiving expire commands

Xiang Li 12 years ago
parent
commit
5a4e764d7a
1 changed files with 3 additions and 0 deletions
  1. 3 0
      server/v2/get_handler.go

+ 3 - 0
server/v2/get_handler.go

@@ -60,6 +60,9 @@ func GetHandler(w http.ResponseWriter, req *http.Request, s Server) error {
 			case <-closeChan:
 			case <-closeChan:
 				return nil
 				return nil
 			case event = <-eventChan:
 			case event = <-eventChan:
+				// for events other than expire, just one event for one watch
+				// for expire event, we might have a stream of events
+				// we use a nil item to terminate the expire event stream
 				if event != nil && event.Action == store.Expire {
 				if event != nil && event.Action == store.Expire {
 					events = append(events, event)
 					events = append(events, event)
 				} else {
 				} else {