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

Alias the disconnect method as close #901

Merged
merged 1 commit into from May 1, 2020
Merged

Conversation

mperham
Copy link
Contributor

@mperham mperham commented Apr 30, 2020

The connection_pool gem is implementing automatic reaping of idle connections. In order to do this generically, clients need to provide a close method that the pool can call on reaped connections in order to close the network connection cleanly.

mysql2 and dalli already provide close. This PR adds this convention to redis-rb.

The connection_pool gem is implementing  automatic reaping of idle connections. In order to do this generically, clients need to provide a `close` method that the pool can call on reaped connections in order to close the network connection cleanly.

mysql2 and dalli already provide `close`. This PR adds this convention to redis-rb.
@byroot
Copy link
Collaborator

byroot commented Apr 30, 2020

Ref: mperham/connection_pool#125

In order to do this generically, clients need to provide a close method that the pool can call on reaped connections in order to close the network connection cleanly.

That alias make sense, and I highly doubt it will ever conflict with a Redis command, so I'll merge.

But I wonder why connection_pool couldn't check for a few common names such as disconnect.

@mperham
Copy link
Contributor Author

mperham commented Apr 30, 2020

Convention over configuration. close seems to be a widely accepted convention for the method we need to call. I don't want to maintain a mapping of clients to method names.

Redis already provides the QUIT command which does what you say; I don't see why they would add CLOSE.

@byroot byroot changed the title Implement close method Alias the disconnect method as close May 1, 2020
@byroot byroot merged commit 5694b00 into redis:master May 1, 2020
@mperham mperham deleted the patch-2 branch June 2, 2020 19:55
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.

None yet

2 participants