CloseIdleConnections closes all idle connections immediately, and marks all connections that are in use to be closed when they become idle again.
()
| 133 | // CloseIdleConnections closes all idle connections immediately, and marks all |
| 134 | // connections that are in use to be closed when they become idle again. |
| 135 | func (t *Transport) CloseIdleConnections() { |
| 136 | t.mutex.Lock() |
| 137 | defer t.mutex.Unlock() |
| 138 | |
| 139 | for _, pool := range t.pools { |
| 140 | pool.unref() |
| 141 | } |
| 142 | |
| 143 | for k := range t.pools { |
| 144 | delete(t.pools, k) |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | // RoundTrip sends a request to a kafka cluster and returns the response, or an |
| 149 | // error if no responses were received. |