add weight for tunnel connector

This commit is contained in:
ginuerzh
2024-01-27 23:31:23 +08:00
parent 43d37d0a5f
commit b5b39de62c
7 changed files with 45 additions and 14 deletions

View File

@ -35,7 +35,7 @@ func (s *roundRobinStrategy[T]) Apply(ctx context.Context, vs ...T) (v T) {
}
type randomStrategy[T any] struct {
rw *randomWeighted[T]
rw *RandomWeighted[T]
mu sync.Mutex
}
@ -43,7 +43,7 @@ type randomStrategy[T any] struct {
// The node will be selected randomly.
func RandomStrategy[T any]() selector.Strategy[T] {
return &randomStrategy[T]{
rw: newRandomWeighted[T](),
rw: NewRandomWeighted[T](),
}
}