(c *Client, err error)
| 404 | } |
| 405 | |
| 406 | func (p *Pool) PutClient(c *Client, err error) { |
| 407 | p.mu.Lock() |
| 408 | defer p.mu.Unlock() |
| 409 | if err != nil || p.closed || !p.isRecyclable(c) { |
| 410 | c.Close() |
| 411 | } else { |
| 412 | cache := p.pool[c.Addr] |
| 413 | if cache == nil { |
| 414 | cache = list.New() |
| 415 | p.pool[c.Addr] = cache |
| 416 | } |
| 417 | cache.PushFront(c) |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | func (p *Pool) Info(addr string) (_ map[string]string, err error) { |
| 422 | c, err := p.GetClient(addr) |
no test coverage detected