mirror of
https://github.com/mperham/connection_pool
synced 2023-03-27 23:22:21 -04:00
Update README.md
This commit is contained in:
parent
6af7c1290b
commit
a83e6f5ea1
1 changed files with 13 additions and 0 deletions
13
README.md
13
README.md
|
@ -68,6 +68,19 @@ end
|
|||
Once you've ported your entire system to use `with`, you can simply remove
|
||||
`Wrapper` and use the simpler and faster `ConnectionPool`.
|
||||
|
||||
You can shut down a ConnectionPool instance once it should no longer be used.
|
||||
Further checkout attempts will immediately raise an error but existing checkouts
|
||||
will work.
|
||||
|
||||
```ruby
|
||||
cp = ConnectionPool.new { Redis.new }
|
||||
cp.shutdown { |conn| conn.close }
|
||||
```
|
||||
|
||||
Shutting down a connection pool will block until all connections are checked in and closed.
|
||||
Note that shutting down is completely optional; Ruby's garbage collector will reclaim
|
||||
unreferenced pools under normal circumstances.
|
||||
|
||||
|
||||
Notes
|
||||
-----
|
||||
|
|
Loading…
Reference in a new issue