Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http2: export CloseIdleConnections in client connection pool #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaricftw
Copy link
Contributor

@jaricftw jaricftw commented May 14, 2020

http2 transport allows stub of ClientConnPool, but both clientConnPoolIdleCloser interface and its closeIdleConnections() method are private. This makes the stubbed ClientConnPool implementation not able to implement closeIdleConnections(). As a result, it will be a no-op when
the transport call transport.CloseIdleConnections().

Therefore, exporting CloseIdleConnections() method is needed. Exporting ClientConnPoolIdleCloser interface is technically not needed, but it makes the API contract more explicit, and allows the stubbed implementation to do something like:

 _ http2.ClientConnPoolIdleCloser = (*clientConnPool)(nil)

@gopherbot
Copy link
Contributor

This PR (HEAD: 3a03f30) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/net/+/233938 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants