Close immediately changes the pool's state so no new connections will be created, then gets and closes the existing ones as they become available.
()
| 357 | // Close immediately changes the pool's state so no new connections will be |
| 358 | // created, then gets and closes the existing ones as they become available. |
| 359 | func (p *Pool) Close() { |
| 360 | close(p.closing) |
| 361 | |
| 362 | for p.created > 0 { |
| 363 | c := <-p.clients |
| 364 | c.Quit() |
| 365 | p.dec() |
| 366 | } |
| 367 | } |