mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-02-02 16:28:39 +08:00
add roundrobin
This commit is contained in:
parent
1670f6cfc3
commit
f498e76def
@ -1,8 +1,11 @@
|
|||||||
package balancer
|
package balancer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
"google.golang.org/grpc/balancer"
|
"google.golang.org/grpc/balancer"
|
||||||
"google.golang.org/grpc/balancer/base"
|
"google.golang.org/grpc/balancer/base"
|
||||||
|
"google.golang.org/grpc/resolver"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -20,6 +23,14 @@ func newBuilder() balancer.Builder {
|
|||||||
return base.NewBalancerBuilder(Name, new(roundRobinPickerBuilder))
|
return base.NewBalancerBuilder(Name, new(roundRobinPickerBuilder))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *roundRobinPickerBuilder) Build(info base.PickerBuildInfo) balancer.Picker {
|
func (b *roundRobinPickerBuilder) Build(readySCs map[resolver.Address]balancer.SubConn) balancer.Picker {
|
||||||
|
panic("implement me")
|
||||||
|
}
|
||||||
|
|
||||||
|
type roundRobinPicker struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *roundRobinPicker) Pick(ctx context.Context, info balancer.PickInfo) (
|
||||||
|
conn balancer.SubConn, done func(balancer.DoneInfo), err error) {
|
||||||
panic("implement me")
|
panic("implement me")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user