wangchuxiao 94d50a6c71 push
2023-02-22 19:51:14 +08:00

17 lines
237 B
Go

package discoveryregistry
import "google.golang.org/grpc"
type Robin struct {
next int
}
func (r *Robin) Robin(slice []*grpc.ClientConn) int {
index := r.next
r.next += 1
if r.next > len(slice)-1 {
r.next = 0
}
return index
}