1
0
Fork 0
mirror of https://github.com/mperham/connection_pool synced 2023-03-27 23:22:21 -04:00

Prep for release

This commit is contained in:
Mike Perham 2021-04-12 04:43:35 -07:00
parent 2009b76085
commit 502df228ca
4 changed files with 12 additions and 13 deletions

View file

@ -1,11 +1,10 @@
# connection_pool Changelog
HEAD
2.2.4
------
- Add `reload` to close all connections, recreating them afterwards [Andrew Marshall, #140]
- Add `then` as a way to use a pool or a bare connection with the
same code path [#138]
- Add `then` as a way to use a pool or a bare connection with the same code path [#138]
2.2.3
------

View file

@ -27,6 +27,10 @@ $memcached.with do |conn|
end
```
If all the objects in the connection pool are in use, `with` will block
until one becomes available. If no object is available within `:timeout` seconds,
`with` will raise a `Timeout::Error`.
You can also use `ConnectionPool#then` to support _both_ a
connection pool and a raw client (requires Ruby 2.5+).
@ -35,10 +39,6 @@ connection pool and a raw client (requires Ruby 2.5+).
$redis.then { |r| r.set 'foo' 'bar' }
```
If all the objects in the connection pool are in use, `with` will block
until one becomes available. If no object is available within `:timeout` seconds,
`with` will raise a `Timeout::Error`.
Optionally, you can specify a timeout override using the with-block semantics:
``` ruby
@ -131,15 +131,15 @@ Notes
- Connections are lazily created as needed.
- There is no provision for repairing or checking the health of a connection;
connections should be self-repairing. This is true of the Dalli and Redis
connections should be self-repairing. This is true of the Dalli and Redis
clients.
- **WARNING**: Don't ever use `Timeout.timeout` in your Ruby code or you will see
occasional silent corruption and mysterious errors. The Timeout API is unsafe
and cannot be used correctly, ever. Use proper socket timeout options as
occasional silent corruption and mysterious errors. The Timeout API is unsafe
and cannot be used correctly, ever. Use proper socket timeout options as
exposed by Net::HTTP, Redis, Dalli, etc.
Author
------
Mike Perham, [@mperham](https://twitter.com/mperham), <http://mikeperham.com>
Mike Perham, [@getajobmike](https://twitter.com/getajobmike), <https://www.mikeperham.com>

View file

@ -1,3 +1,3 @@
class ConnectionPool
VERSION = "2.2.3"
VERSION = "2.2.4"
end

View file

@ -32,7 +32,7 @@ class ConnectionPool
# rubocop:disable Style/MethodMissingSuper
# rubocop:disable Style/MissingRespondToMissing
if ::RUBY_VERSION >= "3.0.0"
if ::RUBY_VERSION >= "2.7.0"
def method_missing(name, *args, **kwargs, &block)
with do |connection|
connection.send(name, *args, **kwargs, &block)