schedulingconfigs

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllSchedulingTypes

func AllSchedulingTypes() []maps.Map

AllSchedulingTypes 所有请求类型

func FindSchedulingType

func FindSchedulingType(code string) maps.Map

Types

type CandidateInterface

type CandidateInterface interface {
	// CandidateWeight 权重
	CandidateWeight() uint

	// CandidateCodes 代号
	CandidateCodes() []string
}

CandidateInterface 候选对象接口

type HashScheduling

type HashScheduling struct {
	Scheduling
	// contains filtered or unexported fields
}

HashScheduling Hash调度算法

func (*HashScheduling) Next

Next 获取下一个候选对象

func (*HashScheduling) Start

func (this *HashScheduling) Start()

Start 启动

func (*HashScheduling) Summary

func (this *HashScheduling) Summary() maps.Map

Summary 获取简要信息

type RandomScheduling

type RandomScheduling struct {
	Scheduling
	// contains filtered or unexported fields
}

RandomScheduling 随机调度算法

func (*RandomScheduling) Next

Next 获取下一个候选对象

func (*RandomScheduling) Start

func (this *RandomScheduling) Start()

Start 启动

func (*RandomScheduling) Summary

func (this *RandomScheduling) Summary() maps.Map

Summary 获取简要信息

type RoundRobinScheduling

type RoundRobinScheduling struct {
	Scheduling
	// contains filtered or unexported fields
}

RoundRobinScheduling 轮询调度算法

func (*RoundRobinScheduling) Next

Next 获取下一个候选对象

func (*RoundRobinScheduling) Start

func (this *RoundRobinScheduling) Start()

Start 启动

func (*RoundRobinScheduling) Summary

func (this *RoundRobinScheduling) Summary() maps.Map

Summary 获取简要信息

type Scheduling

type Scheduling struct {
	Candidates []CandidateInterface
}

Scheduling 调度算法基础类

func (*Scheduling) Add

func (this *Scheduling) Add(candidate ...CandidateInterface)

Add 添加候选对象

func (*Scheduling) HasCandidates

func (this *Scheduling) HasCandidates() bool

HasCandidates 判断是否有候选对象

type SchedulingInterface

type SchedulingInterface interface {
	// HasCandidates 是否有候选对象
	HasCandidates() bool

	// Add 添加候选对象
	Add(candidate ...CandidateInterface)

	// Start 启动
	Start()

	// Next 查找下一个候选对象
	Next(call *shared.RequestCall) CandidateInterface

	// Summary 获取简要信息
	Summary() maps.Map
}

SchedulingInterface 调度算法接口

type StickyScheduling

type StickyScheduling struct {
	Scheduling
	// contains filtered or unexported fields
}

StickyScheduling Sticky调度算法

func (*StickyScheduling) Next

Next 获取下一个候选对象

func (*StickyScheduling) Start

func (this *StickyScheduling) Start()

Start 启动

func (*StickyScheduling) Summary

func (this *StickyScheduling) Summary() maps.Map

Summary 获取简要信息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL