Ai
1 Star 1 Fork 0

鸟窝/rpcx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mode.go 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
鸟窝 提交于 2017-10-31 23:26 +08:00 . users can set their customized selectors
package client
//FailMode decides how clients action when clients fail to invoke services
type FailMode int
const (
//Failover selects another server automaticaly
Failover FailMode = iota
//Failfast returns error immediately
Failfast
//Failtry use current client again
Failtry
)
// SelectMode defines the algorithm of selecting a services from candidates.
type SelectMode int
const (
//RandomSelect is selecting randomly
RandomSelect SelectMode = iota
//RoundRobin is selecting by round robin
RoundRobin
//WeightedRoundRobin is selecting by weighted round robin
WeightedRoundRobin
//WeightedICMP is selecting by weighted Ping time
WeightedICMP
//ConsistentHash is selecting by hashing
ConsistentHash
//Closest is selecting the closest server
Closest
// SelectByUser is selecting by implementation of users
SelectByUser = 1000
)
var selectModeStrs = [...]string{
"RandomSelect",
"RoundRobin",
"WeightedRoundRobin",
"WeightedICMP",
"ConsistentHash",
"Closest",
}
func (s SelectMode) String() string {
return selectModeStrs[s]
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/smallnest/rpcx.git
git@gitee.com:smallnest/rpcx.git
smallnest
rpcx
rpcx
7b90ccb33be5

搜索帮助