Add dial option to set balancer (#1697)

WithBalancerName dial option specifies the name of the balancer to be used by the ClientConn. Service config updates can NOT override the balancer option.
This commit is contained in:
Menghan Li
2017-12-18 15:35:42 -08:00
committed by GitHub
parent 6610f9a340
commit e6549e636d
10 changed files with 110 additions and 45 deletions

View File

@ -83,6 +83,10 @@ func (x *balanceLoadClientStream) Recv() (*lbpb.LoadBalanceResponse, error) {
return m, nil
}
func init() {
balancer.Register(newLBBuilder())
}
// newLBBuilder creates a builder for grpclb.
func newLBBuilder() balancer.Builder {
return NewLBBuilderWithFallbackTimeout(defaultFallbackTimeout)