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

Alias the disconnect method as close #901

merged 1 commit into from May 1, 2020

Conversation

@mperham
Copy link
Contributor

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
Member

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
20 of 21 checks passed
20 of 21 checks passed
Main (ubuntu-latest, 5.0, 2.7, ruby)
Details
Main (ubuntu-latest, 5.0, 2.7, hiredis)
Details
Main (ubuntu-latest, 5.0, 2.7, synchrony)
Details
Main (ubuntu-latest, 5.0, 2.6, ruby)
Details
Main (ubuntu-latest, 5.0, 2.6, hiredis)
Details
Main (ubuntu-latest, 5.0, 2.6, synchrony)
Details
Main (ubuntu-latest, 5.0, 2.5, ruby)
Details
Main (ubuntu-latest, 5.0, 2.5, hiredis)
Details
Main (ubuntu-latest, 5.0, 2.5, synchrony)
Details
Main (ubuntu-latest, 5.0, 2.4, ruby)
Details
Main (ubuntu-latest, 5.0, 2.4, hiredis)
Details
Main (ubuntu-latest, 5.0, 2.4, synchrony)
Details
Sub (ubuntu-latest, 5.0, jruby-9.2.9.0, ruby)
Details
Sub (ubuntu-latest, 5.0, 2.3, ruby)
Details
Sub (ubuntu-latest, 4.0, jruby-9.2.9.0, ruby)
Details
Sub (ubuntu-latest, 4.0, 2.3, ruby)
Details
Sub (ubuntu-latest, 3.2, jruby-9.2.9.0, ruby)
Details
Sub (ubuntu-latest, 3.2, 2.3, ruby)
Details
Sub (ubuntu-latest, 3.0, jruby-9.2.9.0, ruby)
Details
Sub (ubuntu-latest, 3.0, 2.3, ruby) Sub (ubuntu-latest, 3.0, 2.3, ruby)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@mperham mperham deleted the mperham:patch-2 branch Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.