Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SmoothWeightedRoundRobin ¶
type SmoothWeightedRoundRobin[T WeightedServer[T]] struct { sync.RWMutex // contains filtered or unexported fields }
SmoothWeightedRoundRobin 平滑加权轮询调度器
func NewSmoothWeightedRoundRobin ¶
func NewSmoothWeightedRoundRobin[T WeightedServer[T]](servers []T) *SmoothWeightedRoundRobin[T]
NewSmoothWeightedRoundRobin 创建泛型版平滑加权轮询调度器
func (*SmoothWeightedRoundRobin[T]) Add ¶
func (s *SmoothWeightedRoundRobin[T]) Add(server T)
func (*SmoothWeightedRoundRobin[T]) Remove ¶
func (s *SmoothWeightedRoundRobin[T]) Remove(name string)
func (*SmoothWeightedRoundRobin[T]) Select ¶
func (s *SmoothWeightedRoundRobin[T]) Select() T
Select 选择下一个符合权重规则的服务 返回:选中的泛型服务实例(T类型),无可用服务时返回零值
Click to show internal directories.
Click to hide internal directories.