GetEx returns a client with an one-off connection if it's anonymous, otherwise returns existing freelist with Get.
(id proto.NodeID, isAnonymous bool)
| 171 | // GetEx returns a client with an one-off connection if it's anonymous, |
| 172 | // otherwise returns existing freelist with Get. |
| 173 | func (p *ClientPool) GetEx(id proto.NodeID, isAnonymous bool) (cli Client, err error) { |
| 174 | if isAnonymous { |
| 175 | conn, err := DialEx(id, true) |
| 176 | if err != nil { |
| 177 | return nil, err |
| 178 | } |
| 179 | return NewClient(conn), nil |
| 180 | } |
| 181 | return p.Get(id) |
| 182 | } |
| 183 | |
| 184 | // Remove the node freelist in the pool. |
| 185 | func (p *ClientPool) Remove(id proto.NodeID) { |