pickHTTPClient returns the next HTTP client in round-robin order. Each client has a distinct SNI host and connection pool, so successive calls naturally spread requests across separate throttle buckets.
()
| 919 | // client has a distinct SNI host and connection pool, so successive calls |
| 920 | // naturally spread requests across separate throttle buckets. |
| 921 | func (c *Client) pickHTTPClient() *http.Client { |
| 922 | if len(c.httpClients) == 1 { |
| 923 | return c.httpClients[0] |
| 924 | } |
| 925 | idx := c.nextHTTP.Add(1) - 1 |
| 926 | return c.httpClients[idx%uint64(len(c.httpClients))] |
| 927 | } |
| 928 | |
| 929 | // pickRelayEndpoint picks the next non-blacklisted endpoint in round-robin |
| 930 | // order. The per-bucket in-flight semaphore is enforced separately by |
no outgoing calls
no test coverage detected