Skip to content

Commit 55a9106

Browse files
authored
Implement close method
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.
1 parent c97f10c commit 55a9106

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/redis/client.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ def connected?
250250
def disconnect
251251
connection.disconnect if connected?
252252
end
253+
alias_method :close, :disconnect
253254

254255
def reconnect
255256
disconnect

0 commit comments

Comments
 (0)