From 5710bedd7005b8d04da236d71cd6e0fa93b9886c Mon Sep 17 00:00:00 2001 From: iamqizhao <toqizhao@gmail.com> Date: Mon, 16 May 2016 16:36:40 -0700 Subject: [PATCH] polish Balancer comments --- balancer.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/balancer.go b/balancer.go index 2d45eee5..ecfaeb21 100644 --- a/balancer.go +++ b/balancer.go @@ -53,8 +53,9 @@ type Address struct { // Balancer chooses network addresses for RPCs. type Balancer interface { // Up informs the balancer that gRPC has a connection to the server at - // addr. It returns down which will be called once the connection gets - // lost. Once down is called, addr may no longer be returned by Get. + // addr. It returns down which is called once the connection to addr gets + // lost or closed. Once down is called, addr may no longer be returned + // by Get. Up(addr Address) (down func(error)) // Get gets the address of a server for the rpc corresponding to ctx. // It may block if there is no server available. It respects the @@ -91,6 +92,7 @@ func (rr *roundRobin) Up(addr Address) func(error) { } rr.addrs = append(rr.addrs, addr) if len(rr.addrs) == 1 { + // addr is only one available. Notify the Get() callers who are blocking. if rr.waitCh != nil { close(rr.waitCh) rr.waitCh = nil