golang-examples icon indicating copy to clipboard operation
golang-examples copied to clipboard

defer conn.Close()

Open jrots opened this issue 3 years ago • 1 comments

Hi was reading your article here, https://mycodesmells.com/post/pooling-grpc-connections and checking the code -
I was wondering doesn't this peace of code: https://github.com/mycodesmells/golang-examples/blob/37200fe1d687e1f7b8a96fd788e13dc8221083ac/k8s/grpc-pooling/employer/main.go#L72 close the connection in the grpc worker pool each time after a power request? beating the purpose of having a worker pool with long open connections/ clients? Thx!

jrots avatar Sep 17 '21 10:09 jrots

Hi @jrots, That is a very good point, I must have missed that. I’m currently having some time off, but if you feel like fixing it go ahead and give it a try, PRs are welcome 😉 (especially if you are into Hacktoberfest 🙂) If not, I’ll take care of this when I find some time.

slomek avatar Sep 17 '21 10:09 slomek