Skip to content

Commit e157058

Browse files
committed
Add shutdown command to enable management of open sockets without relying on GC or OS to close them
1 parent 4780e89 commit e157058

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/vault/client.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ def pool
158158

159159
private :pool
160160

161+
# Shutdown any open pool connections. Pool will be recreated upon next request.
162+
def shutdown
163+
@nhp.shutdown()
164+
@nhp = nil
165+
end
166+
161167
# Creates and yields a new client object with the given token. This may be
162168
# used safely in a threadsafe manner because the original client remains
163169
# unchanged. The value of the block is returned.

0 commit comments

Comments
 (0)