Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindSchedulingType ¶
Types ¶
type CandidateInterface ¶
候选对象接口
type HashScheduling ¶
type HashScheduling struct {
Scheduling
// contains filtered or unexported fields
}
Hash调度算法
func (*HashScheduling) Next ¶
func (this *HashScheduling) Next(call *shared.RequestCall) CandidateInterface
获取下一个候选对象
type RandomScheduling ¶
type RandomScheduling struct {
Scheduling
// contains filtered or unexported fields
}
随机调度算法
func (*RandomScheduling) Next ¶
func (this *RandomScheduling) Next(call *shared.RequestCall) CandidateInterface
获取下一个候选对象
type RoundRobinScheduling ¶
type RoundRobinScheduling struct {
Scheduling
// contains filtered or unexported fields
}
轮询调度算法
func (*RoundRobinScheduling) Next ¶
func (this *RoundRobinScheduling) Next(call *shared.RequestCall) CandidateInterface
获取下一个候选对象
type SchedulingInterface ¶
type SchedulingInterface interface {
// 是否有候选对象
HasCandidates() bool
// 添加候选对象
Add(candidate ...CandidateInterface)
// 启动
Start()
// 查找下一个候选对象
Next(call *shared.RequestCall) CandidateInterface
// 获取简要信息
Summary() maps.Map
}
调度算法接口
type StickyScheduling ¶
type StickyScheduling struct {
Scheduling
// contains filtered or unexported fields
}
Sticky调度算法
func (*StickyScheduling) Next ¶
func (this *StickyScheduling) Next(call *shared.RequestCall) CandidateInterface
获取下一个候选对象
Click to show internal directories.
Click to hide internal directories.