PoolState returns a snapshot of each key's state in the pool's original order, used by tests and other diagnostic callers. Use Walker for the failover iteration path.
()
| 235 | // original order, used by tests and other diagnostic callers. Use |
| 236 | // Walker for the failover iteration path. |
| 237 | func (p *Pool) PoolState() []KeyState { |
| 238 | states := make([]KeyState, len(p.keys)) |
| 239 | for i := range p.keys { |
| 240 | states[i] = p.keys[i].State() |
| 241 | } |
| 242 | return states |
| 243 | } |
| 244 | |
| 245 | // Walker traverses a Pool for a single request. Each request |
| 246 | // creates its own walker so that it can independently iterate |