Ai
1 Star 0 Fork 0

simon/smallnest

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mode.go 981 Bytes
一键复制 编辑 原始数据 按行查看 历史
simon 提交于 2021-09-04 14:58 +08:00 . 旧版
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
//Failbackup select another server if the first server doesn't respon in specified time and use the fast response.
Failbackup
)
// 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
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/simon_git_code/smallnest.git
git@gitee.com:simon_git_code/smallnest.git
simon_git_code
smallnest
smallnest
e483c3e07d35

搜索帮助