fixed output formatting

This commit is contained in:
yusing
2024-03-18 16:00:45 +00:00
parent 3895718d6d
commit 076c19c4ea
10 changed files with 41 additions and 35 deletions

View File

@@ -20,3 +20,10 @@ func (p *httpLoadBalancePool) Add(route *HTTPRoute) {
func (p *httpLoadBalancePool) Iterator() []*HTTPRoute {
return p.pool
}
func (p *httpLoadBalancePool) Pick() *HTTPRoute {
// round-robin
index := int(p.curentIndex.Load())
defer p.curentIndex.Add(1)
return p.pool[index%len(p.pool)]
}