Skip to content

Fix pool to close all connections when client is closed. #97

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

Merged
merged 1 commit into from
May 5, 2015

Conversation

vmihailenco
Copy link
Collaborator

This is very useful when you want application to exit gracefully. Existing BenchmarkPool numbers are not changed.

Pool was refactored a bit since I want to reuse it in go-pg/pg#52

/cc @dim


// Full reports whether list is full. If list is not full the caller must add or
// remove connection from the pool.
func (l *connList) Full() bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: how about calling this method Reserve? Seems like it would better reflect the purpose.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, sounds much better.

@dim
Copy link
Contributor

dim commented May 5, 2015

Looked over briefly, can't see anything obvious: 👍

@vmihailenco vmihailenco force-pushed the fix/pool-closes-all-connections branch from 0fc3506 to f3f44ae Compare May 5, 2015 09:17
vmihailenco added a commit that referenced this pull request May 5, 2015
Fix pool to close all connections when client is closed.
@vmihailenco vmihailenco merged commit d3a8d04 into master May 5, 2015
@vmihailenco vmihailenco deleted the fix/pool-closes-all-connections branch May 5, 2015 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants