1
0
Fork 0
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:
Mike Perham 2014-05-28 09:14:00 -07:00
parent 6af7c1290b
commit a83e6f5ea1

View file

@ -68,6 +68,19 @@ end
Once you've ported your entire system to use `with`, you can simply remove Once you've ported your entire system to use `with`, you can simply remove
`Wrapper` and use the simpler and faster `ConnectionPool`. `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 Notes
----- -----