pool icon indicating copy to clipboard operation
pool copied to clipboard

连接更新问题

Open Gypsying opened this issue 4 years ago • 1 comments

https://github.com/silenceper/pool/blob/1f4530b6ba1730216c69abdd58f6e35e51636cad/channel.go#L149

在Put方法中,如果发现连接池是满的,这时候是否可以把老的连接删除,把新的连接加进来? 这样可以实时更新连接池了吧 @silenceper @hopehook

Gypsying avatar Nov 23 '19 08:11 Gypsying

连接池是满的, 意味着着空闲的连接比较多.

如果不实时更新连接池, 会让老的连接在 Get 的时候自动淘汰掉. 当然, 在 Put 主动淘汰老连接, 也是可以的, 可能好处不是很明显.

hopehook avatar Mar 02 '21 03:03 hopehook