Skip to content

Commit

Permalink
rename controller
Browse files Browse the repository at this point in the history
  • Loading branch information
iamqizhao committed May 26, 2016
1 parent 9a14ca7 commit db887c9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions clientconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func Dial(target string, opts ...DialOption) (*ClientConn, error) {
return nil, err
}
}
go cc.controller()
go cc.lbWatcher()
}

colonPos := strings.LastIndex(target, ":")
Expand Down Expand Up @@ -302,7 +302,7 @@ type ClientConn struct {
conns map[Address]*addrConn
}

func (cc *ClientConn) controller() {
func (cc *ClientConn) lbWatcher() {
for {
addrs, ok := <-cc.balancer.Notify()
if !ok {
Expand Down Expand Up @@ -333,9 +333,7 @@ func (cc *ClientConn) controller() {
}
cc.mu.Unlock()
for _, a := range addrs {
if err := cc.newAddrConn(a, true); err != nil {

}
cc.newAddrConn(a, true)
}
for _, c := range del {
c.tearDown(errConnDrain)
Expand Down

0 comments on commit db887c9

Please sign in to comment.